Ian Porter ian.porter3 at
Thu Jan 23 20:11:40 UTC 2003

Hi all

I am going thought the tutorial for game programming on the web site.
I have got a error with compiling the last of the tutorials which uses the 
jpeg library, the error is below.

g++ -o BSP  Main.o Init.o Camera.o Quake3Bsp.o Image.o `sdl-config --libs` 
-L/usr/X11R6/lib -lGL -lGLU -lm -ljpeg
Image.o: In function `DecodeJPG(jpeg_decompress_struct*, tImage*)':
Image.o(.text+0x782): undefined reference to 
`jpeg_read_header(jpeg_decompress_struct*, int)'
Image.o(.text+0x790): undefined reference to 
Image.o(.text+0x86d): undefined reference to 
`jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)'
Image.o(.text+0x898): undefined reference to 
Image.o: In function `LoadJPG(char const*)':
Image.o(.text+0x903): undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
Image.o(.text+0x922): undefined reference to 
`jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)'
Image.o(.text+0x93a): undefined reference to 
`jpeg_stdio_src(jpeg_decompress_struct*, _IO_FILE*)'
Image.o(.text+0x977): undefined reference to 
collect2: ld returned 1 exit status
make: *** [BSP] Error 1

This is the makefile
CC			= g++


$(TARGET):	Main.o Init.o Camera.o Quake3Bsp.o Image.o
	$(CC) -o $(TARGET) Main.o Init.o Camera.o Quake3Bsp.o Image.o `sdl-config 
--libs` -L/usr/X11R6/lib -lGL -lGLU -lm -ljpeg 

Main.o:		Main.cpp main.h Camera.h
	$(CC) -c `sdl-config --cflags` Main.cpp

Init.o:		Init.cpp main.h image.h
	$(CC) -c `sdl-config --cflags` Init.cpp

Camera.o :  Camera.cpp main.h Camera.h
	$(CC) -c `sdl-config --cflags` Camera.cpp

Quake3Bsp.o :  Quake3Bsp.cpp main.h Camera.h
	$(CC) -c `sdl-config --cflags` Quake3Bsp.cpp

Image.o :   Image.cpp image.h
	$(CC) -c `sdl-config --cflags` Image.cpp
	rm -f $(TARGET) Main.o Init.o Camera.o Quake3Bsp.o Image.o core

Any advice would be nice.  I have done a search on the web and some one says 
about having to recompile the jpeg sources with g++.  How would I do this ?

Btw I am using Mandrake v9.0 


to unsubscribe from this list send an email to kdevelop-request at with the following body:
unsubscribe »your-email-address«

More information about the KDevelop mailing list