Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Lesson 35 linux. Mistake in makefile


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 AlexB.hpp   Members   -  Reputation: 201

Like
0Likes
Like

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

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.

Edited by AlexB.hpp, 11 October 2012 - 05:02 AM.

C x 2 C x o C x C f nice C x C s C x C c

Sponsor:

#2 Caste   Moderators   -  Reputation: 969

Like
1Likes
Like

Posted 26 October 2012 - 04:25 AM

Thanks for the hints! I'll add them as a note to the lesson!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS