Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAlexB.hpp

Posted 11 October 2012 - 05:02 AM

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'


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$


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.

#2AlexB.hpp

Posted 11 October 2012 - 03:57 AM

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'


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$


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

#1AlexB.hpp

Posted 11 October 2012 - 03:53 AM

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'


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

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

PARTNERS