Does anyone got a work-around for this:
GLH_EXT_SINGLE_FILE ??
If that didn’t mean anything to you, then you most-likely dont
The NVidia demos have a build environment that want’s to have headerfiles, and defines included in only one file. If more than one uses them the linker complains and fails. I’ll fix this on my own, but am open to suggestions from others that have gone down the same path.
Originally posted by jra101: Are you having trouble compiling the SDK or are you having trouble using the glh_extension files in a separate project?
I’ve got the SDK to compile, and I incorporated one of the demos features into a component of my game engine. I’m now trying to incorporate another demo into a different component of the game engine, that is in a different file. When I use the same #defines in another file, I get linking errors. What I would like to do is be able to include the glh stuff from more than one file.
I can give you the specific #defines when I get home.
Jamie
[This message has been edited by amendol (edited 04-25-2003).]
Originally posted by jra101:
[b]What you need to do is to define GLH_EXT_SINGLE_FILE in a single file, but include glh_extensions.h in all files that use the extension functions.
So for example in one of your .cpp’s you would do this:
then in all your other .cpp files, you would just do this:
#include “glh_extensions.h”
That will fix the linker problems.[/b]
Hmm. Still not solved. Here’s the compile output:
g++ -g -Wall glOrbit.cc -o glOrbit -L /usr/X11R6/lib -lGL -lGLU -ltiff -lpthread -lXext -lX11 -lglut -lfreetype -L/home/jamie/SDK/LIBS/lib -lnvparse -lnvpng -L/home/jamie/SDK/DEMOS/OpenGL/src/shared -lnvsdk -lGL -lglut
atmosphere.o
simpleAtmosphere.o
lodAtmosphere.o
lodGF2Atmosphere.o
textureObject.o
utilities.o
clGlAnimate.o
simpleMesh.o
cloudMesh.o
cloudBmpMesh.o
cloudGF4BmpMesh.o
mesh.o
meshFactory.o
meshCartSphereHash.o
meshSphereSphereHash.o
meshGForce2CartSphereHash.o
meshParse.o
texLoader.o
particals.o
fluid.o
gravity.o
collider.o
collision.o
heightMap.o
physics.o
videoManager.o
cloudGF4BmpMesh.o(.bss+0x4):/usr/include/c++/3.2.2/bits/stl_list.h:138: multiple definition of glh::interactors' cloudBmpMesh.o(.bss+0x4):/usr/include/c++/3.2.2/bits/stl_list.h:138: first defined here cloudGF4BmpMesh.o(.bss+0x8):/usr/include/c++/3.2.2/bits/stl_list.h:261: multiple definition of glh: ropagate’
cloudBmpMesh.o(.bss+0x8):/usr/include/c++/3.2.2/bits/stl_list.h:261: first defined here
cloudGF4BmpMesh.o(.text+0x0): In function glh::glut_display_function()': : multiple definition of glh::glut_display_function()’
cloudBmpMesh.o(.text+0x4956):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:89: first defined here
cloudGF4BmpMesh.o(.text+0x96): In function glh::glut_idle_function()': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:96: multiple definition of glh::glut_idle_function()’
cloudBmpMesh.o(.text+0x49ec):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:96: first defined here
cloudGF4BmpMesh.o(.text+0x130): In function glh::glut_keyboard_function(unsigned char, int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:103: multiple definition of glh::glut_keyboard_function(unsigned char, int, int)’
cloudBmpMesh.o(.text+0x4a86):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:103: first defined here
cloudGF4BmpMesh.o(.text+0x1de): In function glh::glut_menu_status_function(int, int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:110: multiple definition of glh::glut_menu_status_function(int, int, int)’
cloudBmpMesh.o(.text+0x4b34):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:110: first defined here
cloudGF4BmpMesh.o(.text+0x280): In function glh::glut_motion_function(int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:117: multiple definition of glh::glut_motion_function(int, int)’
cloudBmpMesh.o(.text+0x4bd6):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:117: first defined here
cloudGF4BmpMesh.o(.text+0x322): In function glh::glut_mouse_function(int, int, int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:124: multiple definition of glh::glut_mouse_function(int, int, int, int)’
cloudBmpMesh.o(.text+0x4c78):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:124: first defined here
cloudGF4BmpMesh.o(.text+0x3ca): In function glh::glut_passive_motion_function(int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:131: multiple definition of glh::glut_passive_motion_function(int, int)’
cloudBmpMesh.o(.text+0x4d20):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:131: first defined here
cloudGF4BmpMesh.o(.text+0x46c): In function glh::glut_reshape_function(int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:138: multiple definition of glh::glut_reshape_function(int, int)’
cloudBmpMesh.o(.text+0x4dc2):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:138: first defined here
cloudGF4BmpMesh.o(.text+0x50e): In function glh::glut_special_function(int, int, int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:145: multiple definition of glh::glut_special_function(int, int, int)’
cloudBmpMesh.o(.text+0x4e64):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:145: first defined here
cloudGF4BmpMesh.o(.text+0x5b0): In function glh::glut_timer_function(int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:152: multiple definition of glh::glut_timer_function(int)’
cloudBmpMesh.o(.text+0x4f06):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:152: first defined here
cloudGF4BmpMesh.o(.text+0x650): In function glh::glut_visibility_function(int)': /home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:159: multiple definition of glh::glut_visibility_function(int)’
cloudBmpMesh.o(.text+0x4fa6):/home/jamie/SDK/DEMOS/OpenGL/inc/glh/glh_glut.h:159: first defined here
collect2: ld returned 1 exit status
make: *** [glOrbit] Error 1
make: Target `all’ not remade because of errors.