I am getting the same link errors since I try to compile with cuda 4.0
I don’t know if it is especially related to thrust, but I am also using thrust.
Note that the runtime libraries are correctly given in both cpp and cuda compilation.
Please help, I have already lost too much time on it and nothing is working anymore…
– pium
edit: I confirm that the error is linked to thrust (by commenting every stuff relative to thrust it compiles/links/works)
edit2: just including a header file from thrust (without using any function) creates the error
In the SDK, the marching cube example is using thrust and is compiling.
By default, this project is using static runtime libraries /MT
A soon as I compiles with dynamic runtime libraries /MD, I obtain a bunch of warnings C4251 relatives to std::basic_string and the same linking errors…
(since I am using compiled libraries that link dynamically I have no choice on this option)
I am stopping to post msg here, but I am going on the thrust bugtracker… :(
Well, you can avoid the error that way, but it does not really fix the issue in a long term. After all, maybe someone wants to build using multithreaded DLLs… ;-)
Despair. There is another thread bumping around (found here) regarding that topic. It appears to be a problem in the NVCC compiler, but so far nobody has found a solution… For the time being, /MT seems to be the only viable option. Of course, maybe we all just overlooked something obvious…
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: char __thiscall std::basic_ios<char,struct std::char_traits<char> >::fill(void)const " (?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const ,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::flush(void)" (?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_streambuf<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::rdbuf(void)const " (?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ) already defined in marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in marchingCubes_kernel.cu.obj
1>../../bin/win32/Release//marchingCubes.exe : fatal error LNK1169: one or more multiply defined symbols found