Forum rules


Before adding a bug or feature request please check it is not already in the bug tracker or answered in the FAQ.



Problems linking to libjpeg

Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Problems linking to libjpeg
PostPosted: Mon Oct 22, 2007 1:13 am 
Uncooked
Not Signed Up For Stats

Joined: Mon Oct 22, 2007 12:44 am
Posts: 4
I'm using Slackware 12.0. I installed wxGTK, OpenAL, freealut, and fftw using the slackbuilds from slackbuilds.org. On fftw I had to add "--enable-float" to configure. I also applied the fix from http://www.scorched3d.co.uk/phpBB2/viewtopic.php?t=4699 since I've got wxGTK 2.8.4 installed. There error I get when running make is:

Code:
g++  -g -O2 -DS3D_DOCDIR=\"/usr/local/games/scorched3d/share/documentation\" -DS3D_DATADIR=\"/usr/local/games/scorched3d/share\" -DS3D_BINDIR=\"/usr/local/games/scorched3d/bin\"  -L/usr/X11R6/lib -L/usr/X11R6 -L/usr/local/lib -o scorched3dc AddTarget.o (insert a ton more object files here) GLSLShaderSetup.o -lfftw3f  -lopenal   -lalut -lfreetype -lz -lGL -lGLU -lpthread  -logg  -lvorbis -lm -lvorbisfile -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread -lSDL_net -lz -lpng -ljpeg
GLJpg.o: In function `GLJpg::loadFromBuffer(NetBuffer&, bool)':
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:162: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:163: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned int)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:178: undefined reference to `jpeg_resync_to_restart(jpeg_decompress_struct*, int)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:185: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:186: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:227: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:228: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/home/erich/pkgs/scorched3d/scorched/src/scorchedc/../GLEXT/GLJpg.cpp:204: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned int)'
collect2: ld returned 1 exit status
make[2]: *** [scorched3dc] Error 1
make[2]: Leaving directory `/home/erich/pkgs/scorched3d/scorched/src/scorchedc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/erich/pkgs/scorched3d/scorched/src'
make: *** [all-recursive] Error 1


GLEXT/GLJpg is including jpeglib.h, which for me is in /usr/include. I have libjpeg-6b installed. All the "undefined references" listed above are present in /usr/include/libjpeg.h. Is usr/lib, libjpeg.so symlinks to libjpeg.so.62 which symlinks to libjpeg.so.62.0.0

Any ideas as to why linkings is failing?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 22, 2007 1:44 am 
Uncooked
Not Signed Up For Stats

Joined: Mon Oct 22, 2007 12:44 am
Posts: 4
I managed to get it to compile by wrapping the include statement for jpeglib in an extern "C" statement.
Change the following in src/GLEXT/GLJpg.cpp:
Code:
extern "C" {
  #include <jpeglib.h>
}


As mentioned it now compiles and I installed it. However, when I try to run it I get the following error:

$ scorched3d
Fatal Error: Mismatch between the program and library build versions detected.
The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.4,compatible with 2.6).
Aborted


I suspect the wxGTK 2.8 fix I applied from http://www.scorched3d.co.uk/phpBB2/viewtopic.php?t=4699 wasn't enough.
Code:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 22, 2007 1:49 am 
User avatar
Reduced to ashes
Not Signed Up For Stats

Joined: Fri Jan 06, 2006 12:11 am
Posts: 639
Location: The Dark Side of the Earth
drumz wrote:
The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6),
and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.4,compatible with 2.6).


as you can see, the wx source library you used to compile scorched3d, is slightly different from the one you have installed & precompiled; if you used your distro libraries, then i guess they did something wrong there

if you compiled/installed the wxwidgets library yourself, then i'd suggect you to double check the ./configure flags you used
Proudly without signature :P

Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 22, 2007 2:12 am 
Uncooked
Not Signed Up For Stats

Joined: Mon Oct 22, 2007 12:44 am
Posts: 4
I did some more checking and I had wxWidgets and wxGTK installed. Come to find out they're the same thing so I removed both of them and am reinstalling/compiling wxGTK and will then recompile scorched3d. I have a 1.3GHz Pentium-M, so this could take awhile...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 23, 2007 4:38 am 
Uncooked
Not Signed Up For Stats

Joined: Mon Oct 22, 2007 12:44 am
Posts: 4
I recompiled wxGTK with --enable-compat24 and then tried again. Now it works.

Thanks for the help!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group