Welcome! Log In Create A New Profile

Advanced

Undefined JPEG_decompress()

Posted by diego_pmc 
Undefined JPEG_decompress()
February 01, 2010 12:26PM
I am having some problems with my code. When it tries to link the objects and create the *.dol file it gives me an error that says:
Quote

main.cpp:130: undefined reference to 'JPEG_Decompress(JPEGIMG*)'

These are the libs in my Makefile. Could someone please tell me how I'm supposed to arrange them in order for this to work?
-lasnd -lmad -lfat -lwiiuse -lbte -logc -lm -ljpeg



Edited 1 time(s). Last edit at 02/01/2010 12:34PM by diego_pmc.
Re: Undefined JPEG_decompress()
February 01, 2010 02:09PM
Did you include jpeglib.h in main.cpp?
Re: Undefined JPEG_decompress()
February 01, 2010 02:15PM
Yes, I did. Here's my project folder (it's just CodeMii's tut8 with some modifications):
? [upload.worldofplayers.de]
Re: Undefined JPEG_decompress()
February 01, 2010 02:21PM
Quote
diego_pmc
-lasnd -lmad -lfat -lwiiuse -lbte -logc -lm -ljpeg
Try this order:
-lasnd -lmad -ljpeg -lfat -lwiiuse -lbte -logc -lm
Re: Undefined JPEG_decompress()
February 01, 2010 02:52PM
It doesn't work. :(
Re: Undefined JPEG_decompress()
February 01, 2010 03:24PM
Stupid question, but did you installed libjpeg?
Re: Undefined JPEG_decompress()
February 01, 2010 03:34PM
BTW, libjpeg only use function starting with lower case, like jpeg_create_decompress. So I don't know where JPEG_Decompress is from.
Re: Undefined JPEG_decompress()
February 01, 2010 04:10PM
Yes, I installed the library (installed it together with GRRLIB).
About JPEG_Decompress(): my code is a modification of the tutorial al CodeMii. When I compile the tutorial I get no errors; seems the undefined function error appears only when I change the externsion from *.c to *.cpp.
Also, JPEG_Decompress() does exist; the prototype is found on line 27 of jpgogc.h:
JPEG_Decompress(JPEGIMG * jpgimg);



Edited 1 time(s). Last edit at 02/01/2010 04:13PM by diego_pmc.
Re: Undefined JPEG_decompress()
February 01, 2010 04:28PM
Phew, I solved it. Thanks for the help. I solved the problem by changing line 27 from jpgogc.h I mentioned above with this:

#if defined(__cplusplus)
extern "C"
{
#endif

int JPEG_Decompress(JPEGIMG * jpgimg);

#if defined(__cplusplus)
}
#endif
Sorry, only registered users may post in this forum.

Click here to login