Re: Runing Tut 01

Am reading Learning Modern 3D Graphics Programming by Jason L. McKesson

Am having some trouble running the tutorials. First I thought they would be a documentation directory from the instructions but I can not find it in any versions of the tutorial.

Anyways I think my problem is running the tutorials because I get an information log of " You must select a host application to run a library…

Am using ubuntu 12.04 with codeblocks. I did run premake4 in the glsdk directory and run codeblocks to build the files there and in the case of Tutorial 3.7, I did the same in the xml folder. After I ran premake in Tut 01 directory ran codeblocks with the workspace created. Built the files with codeblocks but can not run them.

Will be very grateful for the help

You have to right-click on the project you want to run and set it as the active project.

Thank you very much Alfonse.

I did that and now a getting the following errors when I run the program.

Reparsing saved files…
Linking console executable: Tut 01 MainD
/usr/bin/ld: error: cannot find -lglimgD
/usr/bin/ld: error: cannot find -lglutilD
/usr/bin/ld: error: cannot find -lglmeshD
/usr/bin/ld: error: cannot find -lfreeglutD
/home/francis/Desktop/CBooks/Tutorial 0.3.8/Tut 01 Hello Triangle/tut1.cpp:155: error: undefined reference to ‘glutSwapBuffers’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/Tut 01 Hello Triangle/tut1.cpp:174: error: undefined reference to ‘glutLeaveMainLoop’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:37: error: undefined reference to ‘glutil::CompileShader(unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:50: error: undefined reference to ‘glutil::LinkProgram(std::vector<unsigned int, std::allocator<unsigned int> > const&, bool)’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:132: error: undefined reference to ‘glutInit’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:139: error: undefined reference to ‘glutInitDisplayMode’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:140: error: undefined reference to ‘glutInitContextVersion’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:141: error: undefined reference to ‘glutInitContextProfile’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:143: error: undefined reference to ‘glutInitContextFlags’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:145: error: undefined reference to ‘glutInitWindowSize’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:146: error: undefined reference to ‘glutInitWindowPosition’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:147: error: undefined reference to ‘glutCreateWindow’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:151: error: undefined reference to ‘glutSetOption’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:157: error: undefined reference to ‘glutDestroyWindow’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:169: error: undefined reference to ‘glutDisplayFunc’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:170: error: undefined reference to ‘glutReshapeFunc’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:171: error: undefined reference to ‘glutKeyboardFunc’
/home/francis/Desktop/CBooks/Tutorial 0.3.8/framework/framework.cpp:172: error: undefined reference to ‘glutMainLoop’
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
22 errors, 0 warnings
Starting batch parsing…

Thought this might be the problem but I have it already installed
apt-get install libgl1-mesa-glx
Reading package lists… Done
Building dependency tree
Reading state information… Done
libgl1-mesa-glx is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.

Will appreciate your help

Did you build the SDK before trying to build the tutorials?

Going to try to build the SDK thank you sorry for the delay

Sorry for the Late replies. Been struggling with trying to find a solution for my GPU to support Opengl 3.0
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel® Ironlake Mobile
OpenGL version string: 2.1 Mesa 9.0
OpenGL shading language version string: 1.20
OpenGL extensions:
I thought upgrading Ubuntu to 12.10 could help but didn’t

Can anyone help with this or I will have to get a different machine ?

Well, that’s not something I can help you with. If your hardware can’t support OpenGL 3.3, then the tutorials aren’t going to work for you. They should compile, but you won’t be able to run them.

Got an HP pavilion g6 with Ubuntu 12.10, Radeon hd 7520g Installed the fglrx drivers with codeblocks. Built all the SDK except freeglut.
||=== Build: Debug in freeglut (compiler: GNU GCC Compiler) ===|
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c||In function ‘fghJoystickOpen’:expressionless:
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1430|error: ‘O_RDONLY’ undeclared (first use in this function)|
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1430|note: each undeclared identifier is reported only once for each function it appears in|
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1448|error: ‘F_SETFL’ undeclared (first use in this function)|
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1448|error: ‘O_NONBLOCK’ undeclared (first use in this function)|
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c||In function ‘fghJoystickInit’:expressionless:
/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1597|error: ‘F_OK’ undeclared (first use in this function)|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

The only viable solution I found was to remove the freeglut_joystick.c which didn´t go very well any help would be helpful

Thanks for your help in advance

Well looks like the way to go is to use gmake to build freeglut. so run make config=debug and make config=release and I get the following linker errors

make[3]: Entering directory /home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/include/GL' make[3]: Nothing to be done forall’.
make[3]: Leaving directory /home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/include/GL' make[3]: Entering directory/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/include’
make[3]: Nothing to be done for all-am'. make[3]: Leaving directory/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/include’
make[2]: Leaving directory /home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/include' Making all in progs make[2]: Entering directory/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/progs’
Making all in demos
make[3]: Entering directory /home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/progs/demos' Making all in CallbackMaker make[4]: Entering directory/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/progs/demos/CallbackMaker’
/bin/bash …/…/…/libtool --tag=CC --mode=link gcc -I…/…/…/include -g -O2 -Wall -pedantic -export-dynamic …/…/…/src/libglut.la -o CallbackMaker CallbackMaker-CallbackMaker.o
gcc -I…/…/…/include -g -O2 -Wall -pedantic -o .libs/CallbackMaker CallbackMaker-CallbackMaker.o -Wl,–export-dynamic …/…/…/src/.libs/libglut.so
/usr/bin/ld: CallbackMaker-CallbackMaker.o: undefined reference to symbol ‘glEnable’
/usr/bin/ld: note: ‘glEnable’ is defined in DSO /usr/lib64/libGL.so.1 so try adding it to the linker command line
/usr/lib64/libGL.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[4]: *** [CallbackMaker] Error 1
make[4]: Leaving directory /home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/progs/demos/CallbackMaker' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/progs/demos’
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut/progs' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/iyit/Desktop/CBGL/Tutorial 0.3.8/glsdk/freeglut’

Help will be appreciated

Iyit

It looks like you’re using the premake4.lua file in the FreeGLUT directory. You shouldn’t be. Remember the steps from the manual: go to the SDK directory, run the premake4 command there, then build using the generated build files. You shouldn’t be running premake4 in the FreeGLUT directory.

And of course, I shouldn’t be distributing that file.