Page 1 of 1

My linux compiling troubles.

Posted: Wed Aug 27, 2003 6:40 am
by Caecus
Problem from a while back... Never solved it, time for round 2?

When trying to "make" the HelloWorld example I get the following errors...

Code: Select all

[caecus@localhost 1.HelloWorld]$ make
g++ main.cpp -o example -I"../../include" -I"/usr/X11R6/include" -L"/usr/X11R6/lib" -L"../../source" -L"../../source/jpeglib" -L"../../source/zlib" -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lz -ljpeg
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x25f): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_std_error'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x27e): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_CreateDecompress'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x2d9): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_resync_to_restart'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x2f4): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_read_header'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x306): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_start_decompress'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x430): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_read_scanlines'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x468): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_finish_decompress'
/lib/libIrrlicht.a(CSurfaceLoaderJPG.o)(.text+0x47a): In function `irr::video::CSurfaceLoaderJPG::loadImage(irr::io::IReadFile*)':
: undefined reference to `jpeg_destroy_decompress'
collect2: ld returned 1 exit status
make: *** [all] Error 1


And when trying to "make" the engine lib after unzipping source I get the following errors...

Code: Select all

g++ -c CVideoOpenGL.cpp -o CVideoOpenGL.o --static -I"include/"
CVideoOpenGL.cpp: In member function `virtual void
   irr::video::CVideoOpenGL::drawIndexedTriangleList(const
   irr::video::S3DVertex*, int, const u16*, int)':
CVideoOpenGL.cpp:311: `glClientActiveTextureARB' undeclared (first use this
   function)
CVideoOpenGL.cpp:311: (Each undeclared identifier is reported only once for
   each function it appears in.)
CVideoOpenGL.cpp: In member function `void
   irr::video::CVideoOpenGL::setTexture(int, irr::video::ITexture*)':
CVideoOpenGL.cpp:626: `glActiveTextureARB' undeclared (first use this function)
make: *** [CVideoOpenGL.o] Error 1

I have MesaGL devel RPM and the jpeglib devel rpm installed (as well as the non devel counterparts)...


I'm really new to all this Linux stuff, I hope someone here can give me some help.

Posted: Wed Aug 27, 2003 8:39 am
by niko
I'm new too. ;) I don't really know a solution for this, because I don't understand the problems. At least the one with the jpegLib. I think the OpenGL problems are there because maybe your OpenGL does not have the extensions I use, but I am just guessing. I'll play around with this, when my new computer arrives, Linux does not like my notebook. :)

Posted: Wed Aug 27, 2003 3:20 pm
by Caecus
Hehe. Well thanks as always Niko. If any linux gurus are hanging around here, feel free to drop in an make suggestions :)

Posted: Wed Aug 27, 2003 4:34 pm
by rogerdv
I think that the jpeg problems are that you are linking against a lib other than the the used to compile the engine. So, some functions are missing.

Posted: Wed Aug 27, 2003 6:20 pm
by niko
I can't believe that this is because of another version of the lib. The function names listed in the error messages are the most common functions of the jpeglib. But to try it out: You could recompile the jpegLib, it can be found in the source.zip in the Irrlicht Engine SDK.

Posted: Wed Aug 27, 2003 8:21 pm
by rogerdv
Sorry, my mistake. Check your makefiles, I think you are not linking libjpeg at all.

Posted: Thu Aug 28, 2003 10:37 am
by Raumkraut
I'm having the same problem compiling the engine. Haven't tried compiling any of the other things, obv.

Is this a symptom of the not-linking-libjpeg problem, too?
I've got the libjpeg and libjpeg-devel RPMs installed, and whereis libjpeg points me to /usr/lib/

I'm even newer to compiling under linux than I am under dev-c++, so some newbie-speak probably wouldn't be amiss. ;)

Posted: Thu Aug 28, 2003 11:23 am
by rogerdv
I think so. All *undefined references* means that your compiler cant find the symbol at linking time.
This is what i did yesterday to get a working lib under linux and avoid the runtime error produced when you use a different jpeg lib:
1- Unzip the sources (and dont touch the jpeg directory)
2- Compile irrlicht with make. That will rebuild jpeg lib too
3- Take the engine lib at /lib/Linux
4- Take the jpeg lib in source/jpeg directory
5- Use both libs for your app linking proccess. For this create a /lib directory in your app tree and add this to your compiling flags -L,,lib,, Sorry for the ,, but I updated my browser and now I cant type the correct character and forgot the english name.

Posted: Thu Aug 28, 2003 12:29 pm
by Raumkraut
My problem is with step 2, which brings up the aforementioned error (second one in the original post)
Oh, hang on... I don't need to do this do I!? Dumbarse! :roll:

Now that you've guided me to the -I and -L parameters, I've got helloworld to compile and run! Woot! Thanks! :D
Wahey, I can now do something which isn't work, at work, while looking like I'm working! :D


BTW, If you mean the " character, it's "double quote". Well, perhaps not linguistically accurate, but people will generally know what you mean. :)