• Advertisement
Sign in to follow this  

Lesson 35 linux. Mistake in makefile

This topic is 1914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Good day for you.

I've got an error in lesson 35 (Playing avi in OpenGL) on compilation.


alexb@alexb-GA-MA770-UD3:~/Projects/lesson35_linux$ make
g++ -g -O2 -Wall -I./ -I/usr/include -L./ -L/usr/lib/ -L/usr/lib/fglrx/ -lglut -lGL -lGLU -laviplay lesson35.cpp -o lesson35
lesson35.cpp: In function ‘int main(int, char**)’:
lesson35.cpp:116:49: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/tmp/cc8tev0Q.o: In function `display_func()':
/home/alexb/Projects/lesson35_linux/lesson35.cpp:365: undefined reference to `glClear'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:382: undefined reference to `glLoadIdentity'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:383: undefined reference to `glTranslatef'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:391: undefined reference to `glRotatef'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:392: undefined reference to `glRotatef'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:393: undefined reference to `glTranslatef'
[/QUOTE]

An actually I've got the problem. It's in makefile.
all:
$(CC) $(CC_OPT) $(INCLUDES) $(LIBS) lesson35.cpp -o lesson35

there is wrong order of options.
For g++ as CC you should use the next one:
all:
$(CC) lesson35.cpp $(CC_OPT) $(INCLUDES) $(LIBS) -o lesson35


alexb@alexb-GA-MA770-UD3:~/Projects/lesson35_linux$ make
g++ lesson35.cpp -lglut -lGL -lGLU -laviplay -o lesson35
lesson35.cpp: In function ‘int main(int, char**)’:
lesson35.cpp:116:49: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
alexb@alexb-GA-MA770-UD3:~/Projects/lesson35_linux$[/quote]

added

There is another mistake in lesson35.cpp. At line 71-72

StreamInfo *streaminfo = 0; // represents the avi streaminfo

g++ says that StreamInfo isn't a type.

To fix it you should replace:

#include <avifile/StreamInfo.h>
with
#include <avifile/infotypes.h>

because of StreamInfo doesn't work without AVIFILE_INFOTYPES_H in avifile-0.7.

Add namespace specifier here
avm::StreamInfo *streaminfo = 0;

Thanks to Jeff Molofee (NeHe), Fredster and Jonathan de Blok for the lesson. Edited by AlexB.hpp

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement