PDA

View Full Version : nvidia sdk problem



mogu
12-20-2001, 07:40 AM
I've been testing the nvidia sdk, lotsa nice stuff. My broblem is when I try to include the different header files in more than one file I get errors like this:

stdInclude.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1iARB)(unsigned int,int)" (?glMultiTexCoord1iARB@@3P6GXIH@ZA) already defined in test.obj
stdInclude.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1fvARB)(unsigned int,float const *)" (?glMultiTexCoord1fvARB@@3P6GXIPBM@ZA) already defined in test.obj
stdInclude.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1fARB)(unsigned int,float)" (?glMultiTexCoord1fARB@@3P6GXIM@ZA) already defined in test.obj
stdInclude.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1dvARB)(unsigned int,double const *)" (?glMultiTexCoord1dvARB@@3P6GXIPBN@ZA) already defined in test.obj
stdInclude.obj : error LNK2005: "void (__stdcall* glMultiTexCoord1dARB)(unsigned int,double)" (?glMultiTexCoord1dARB@@3P6GXIN@ZA) already defined in test.obj
Debug\RaceCarIsectD.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Creating browse info file...

RaceCarIsectD.exe - 438 error(s), 0 warning(s)


I also have tried moving the header files in a precompiled header, getting even more errors. I'm compiling using multithreading in my settings. The problem seems to be because many of nvidia's header files uses inline functions.

I'm sure it's only a stupid linker setting, but please help me....

-Mogu-

jacobmarner
12-21-2001, 08:29 AM
First, let me warn you that I am no nVidia SDK expert. But I think I know the answer to your problem.

This is a generic linker error if you include the function *definitions* more than once. I don't know what headers you include, but glMultiTexCoord1iARB is defined in glh_genext.h so this should only be included from one module. However the same function is *declared* in glext.h and including that file will not give duplicate symbol errors.

So in one module/file include glh_genext.h (you probably do this indirectly by including glh_extensions.h) and in the rest only include glext.h

Cheers,
Jacob