Hi everyone,
I’m trying to build a Visual Studio 2008 solution (windows 7 pro 64 bits) that has almost 300 hundred projects. We’re using dynamic libraries and I’m wondering whether it’s related to the flag /MD. I’ve seen similar posts here with Thrust for instance (http://forums.nvidia…howtopic=195470). This problem is solved now (not sure if it was nvcc or[font=“arial, verdana, tahoma, sans-serif”] the SDK Marching cube example itself). And I’ve seen quite a few problems everywhere with /MD compilation. But it may be another issue. [/font]I also need to say that the whole solution compiles with CUDA 2.2 (which is the version used previously). I just joined the team and I’d like to update to CUDA 4.0 for obvious reasons.
[font=“arial, verdana, tahoma, sans-serif”] [/font]
[font=“arial, verdana, tahoma, sans-serif”]Here the type of errors I get:[/font]
[font=“arial, verdana, tahoma, sans-serif”]
156>solver_cudad.lib(solver_cuda_generated_LibCuda.cu.obj) : error LNK2005: "void __cdecl function1(float *,float *)" (?function1@@YAXPEAM0@Z) already defined in LibThing_test.obj
155>Embedding manifest...
156>solver_cudad.lib(solver_cuda_generated_LibCuda.cu.obj) : error LNK2005: "void __cdecl function2(float *,float *,float *)" (?function2@@YAXPEAM00@Z) already defined in LibThing_test.obj
111>QtHoverPoints.cpp
156>solver_cudad.lib(solver_cuda_generated_LibCuda.cu.obj) : error LNK2005: "void __cdecl function3(float *,float &)" (?function3@@YAXPEAMAEAM@Z) already defined in LibThing_test.obj
156>solver_cudad.lib(solver_cuda_generated_LibCuda.cu.obj) : error LNK2005: "void __cdecl function4(float *,float,float *)" (?function4@@YAXPEAMM0@Z) already defined in LibThing_test.obj
156>solver_cudad.lib(solver_cuda_generated_LibCuda.cu.obj) : error LNK2005: "void __cdecl function5(float *,float &)" (?function5@@YAXPEAMAEAM@Z) already defined in LibThing_test.obj
156>...\build\Build_win64\bin\Debug\test_solver_lib.exe : fatal error LNK1169: one or more multiply defined symbols found
[/font]
[font=“arial, verdana, tahoma, sans-serif”] [/font]
[font=“arial, verdana, tahoma, sans-serif”]I’m not familiar with the windows development platform (I usually develop on Mac or linux) so I might be missing something and could be a problem quite simple to solve. And since everything works fine with CUDA 2.2, I tend to think that our project’s configuration is not bad. Are you aware of any change in nvcc between 2.2 and 4.0 related to the rules of compilation? For the sake of completeness, I generate the makefiles using CMake 2.8.4 (I say this because I think it means that I’m using CMake rules for compiling .cu files and not the rules given by NVIDIA with his toolkit I believe, but maybe someone can confirm this).[/font]
[font=“arial, verdana, tahoma, sans-serif”] [/font]
[font=“arial, verdana, tahoma, sans-serif”]Maybe I should add a few additional pieces of information: [/font][font=“arial, verdana, tahoma, sans-serif”]LibThing_test.cpp includes “LibA.h” and LibA.h includes “LibB.h”. And S[/font][font=“arial, verdana, tahoma, sans-serif”]olver_cuda[/font][font=“arial, verdana, tahoma, sans-serif”].cu includes “LibB.h”. function1 to function5 are all defined in LibB.h. However, if the organisation of my files was bad, why does it compile with CUDA 2.2?[/font]
[font=“arial, verdana, tahoma, sans-serif”] [/font]
[font=“arial, verdana, tahoma, sans-serif”]Any help would be very much appreciated.[/font]