Original Post
Good day for you.
I've got an error in lesson 35 (Playing avi in OpenGL) on compilation.
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 functiondisplay_func()':glClear'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:365: undefined reference to
/home/alexb/Projects/lesson35_linux/lesson35.cpp:382: undefined reference toglLoadIdentity'glTranslatef'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:383: undefined reference to
/home/alexb/Projects/lesson35_linux/lesson35.cpp:391: undefined reference toglRotatef'glRotatef'
/home/alexb/Projects/lesson35_linux/lesson35.cpp:392: undefined reference to
/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.