Advertisement

Linux...

Started by September 14, 2002 04:03 AM
1 comment, last by Zoot 22 years, 5 months ago
I installed linux last week... I have got open working but not with Lesson 26.. What is wrong? I get this when i am trying to compile it.. zoot@debian400:~/opengl/lesson26$ make cc -c Lesson26.cpp cc -c image.c cc -o Lesson26 -L/usr/X11R6/lib -lGL -lGLU -lglut image.o Lesson26.o Lesson26.o: In function `LoadGLTextures(void)'': Lesson26.o(.text+0xaa): undefined reference to `ImageLoad(char *)'' Lesson26.o(.text+0xc9): undefined reference to `ImageLoad(char *)'' Lesson26.o(.text+0xe8): undefined reference to `ImageLoad(char *)'' collect2: ld returned 1 exit status make: *** [all] Error 1 zoot@debian400:~/opengl/lesson26$
GSACP: GameDev Society Against Crap PostingTo join: Put these lines in your signature and don't post crap!
The problem is poorly written code. Change image.h to this (all I did was add the C++ check, as you can see):
#ifndef __IMAGE_H__#define __IMAGE_H__#ifdef __cplusplusextern "C" {#endiftypedef struct{    unsigned short imagic;    unsigned short type;    unsigned short dim;    unsigned short sizeX, sizeY, sizeZ;    char name[128];	unsigned char *data;} IMAGE;IMAGE *ImageLoad(char *);#ifdef __cplusplus}#endif#endif /* !__IMAGE_H__! */ 

After that make sure you do a clean rebuild (make clean all).



[edited by - Null and Void on September 14, 2002 5:13:15 AM]
Advertisement
Works fine... but i renamed image.c to image.cpp and fixed the makefile...
GSACP: GameDev Society Against Crap PostingTo join: Put these lines in your signature and don't post crap!

This topic is closed to new replies.

Advertisement