Hi all,
this post is following The Official NVIDIA Forums | NVIDIA and Google Code Archive - Long-term storage for Google Code Project Hosting.
As soon as a Thrust’s header file is included in a Cuda 4.0 project (no need to call a function), the compiler gives warnings and the linker gives errors (sorry for the french output!)
For my basic testing, I used the Marching cubes example delivered with the cuda SDK.
-
cuda 3.2 + thrust 1.3 → no problem in both /MT and /MD
-
cuda 3.2 + thrust 1.4 → no problem in both /MT and /MD
-
cuda 4.0 + thrust 1.4 → no problem in /MT (default)
-> compilation warnings + link errors in /MD
Note that the runtime library option has been modified and is similar in ALL .cpp and .cu files (actually 2 files in the Marching Cubes example)
I am suspecting a bug in nvcc. I don’t think it comes directly from Thrust but it could come from the way Thrust is including std files.
What do you think ? Have you an idea on how to compile with the /MD option?
– pium
3>marchingCubes_kernel.cu
3>tmpxft_00001004_00000001-6_marchingCubes_kernel.compute_10.cudafe1.cpp
3>tmpxft_00001004_00000001-23_marchingCubes_kernel.compute_10.ii
3>c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocinfo(193) : warning C4251: 'std::_Locinfo::_Days' : class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface DLL pour être utilisé(e) par les clients de class 'std::_Locinfo'
3> with
3> [
3> _Elem=char,
3> _Traits=std::char_traits<char>,
3> _Ax=std::allocator<char>
3> ]
3>c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocinfo(194) : warning C4251: 'std::_Locinfo::_Months' : class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface DLL pour être utilisé(e) par les clients de class 'std::_Locinfo'
3> with
3> [
3> _Elem=char,
3> _Traits=std::char_traits<char>,
3> _Ax=std::allocator<char>
3> ]
3>c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocinfo(195) : warning C4251: 'std::_Locinfo::_Oldlocname' : class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface DLL pour être utilisé(e) par les clients de class 'std::_Locinfo'
3> with
3> [
3> _Elem=char,
3> _Traits=std::char_traits<char>,
3> _Ax=std::allocator<char>
3> ]
3>c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocinfo(196) : warning C4251: 'std::_Locinfo::_Newlocname' : class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface DLL pour être utilisé(e) par les clients de class 'std::_Locinfo'
3> with
3> [
3> _Elem=char,
3> _Traits=std::char_traits<char>,
3> _Ax=std::allocator<char>
3> ]
3>c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(245) : warning C4251: 'std::locale::_Locimp::_Name' : class 'std::basic_string<_Elem,_Traits,_Ax>' nécessite une interface DLL pour être utilisé(e) par les clients de class 'std::locale::_Locimp'
3> with
3> [
3> _Elem=char,
3> _Traits=std::char_traits<char>,
3> _Ax=std::allocator<char>
3> ]
1>------ Début de la génération : Projet : marchingCubes, Configuration : Release Win32 ------
1>Édition des liens en cours...
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@ABV01@@Z) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (??4?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV01@PBD@Z) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) déjà défini(e) dans marchingCubes_kernel.cu.obj
1>../../bin/win32/Release/marchingCubes.exe : fatal error LNK1169: un ou plusieurs symboles définis à différentes reprises ont été rencontrés
1>Le journal de génération a été enregistré à l'emplacement "file://c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\marchingCubes\Release\BuildLog.htm"
1>marchingCubes - 8 erreur(s), 0 avertissement(s)
========== Génération : 0 a réussi, 1 a échoué, 2 mis à jour, 0 a été ignoré ==========