Question

How do I use libjpeg in a 'Cocoa Application' project? I included the static library [libjpeg.a] and the header files[jpeglib.h, jconfig.h, jerror.h and jmorecfg.h] using the "Add Files to Project_Name" option in XCode. I am getting the following error in jmorecfg.h when I hit on build & run

Expected }

When I write a c file and use libjpeg in NetBeans, it is working fine. But, I wanted to use it inside my 'Cocoa Application' project. Please guide me in the right direction

Was it helpful?

Solution

Adding the following line to jconfig.h solved the problem.

#define USE_MAC_MEMMGR

In jmemmac.c, I found the following code which helped me to fix it. Just adding the above line worked!

#ifndef USE_MAC_MEMMGR  /* make sure user got configuration right */
    You forgot to define USE_MAC_MEMMGR in jconfig.h. /* deliberate syntax error */
#endif
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top