3.1. compilation problem: warning: dllexport/dllimport conflict with "printf", import drop

Hello,

I have a very similar problem, to this clock compilation problem: http://forums.nvidia.com/index.php?showtop…rt=#entry531449

but the solution there does not help…

I am compiling with -arch=sm_20 but somehow

2>c:\cuda\include\common_functions.h(73): warning: dllexport/dllimport conflict with "printf"

2>c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(287): here; dllimport/dllexport dropped

2>tmpxft_000013c4_00000000-3_slicerRenderer.cudafe1.gpu

2>tmpxft_000013c4_00000000-8_slicerRenderer.cudafe2.gpu

2>slicerRenderer.cu

2>c:\visdom\views\views\slicernode\slicerRenderer_kernel.cuh(48): error: identifier "printf" is undefined

this does not solve the problem: http://forums.nvidia.com/index.php?showtop…rt=#entry531449

you can see here that both main project and nvcc use the MDd flag

nvcc cmd line

C:/CUDA/bin64/nvcc.exe -M -D__CUDACC__ C:/visdom/views/views/slicernode/slicerRenderer.cu -o C:/visdom/build/views/views/CMakeFiles/views_generated_slicerRenderer.cu.obj.NVCC-depend -ccbin “c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin” -m64 -DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0501 -Dviews_EXPORTS -Xcompiler ,"/DWIN32","/D_WINDOWS","/W3","/Zm1000","/EHsc","/GR","/MP","/D_DEBUG","/MDd","/Zi","/Ob0","/Od","/RTC1" -arch=sm_20 -DNVCC -IC:/CUDA/include -IC:/visdom/build/views/views -IC:/visdom/views/views -IC:/visdom/build/views/views/src/xsd -IC:/visdom/core -IC:/visdom/build/core/server/src/xsd -IC:/visdom/build/core/dataflow/src/xsd -IC:/visdom/build/core/datastructures/src/xsd -IC:/visdom/build/core/utils/src/xsd “-IC:/Program Files (x86)/CodeSynthesis XSD 3.3/include” -IC:/visdom/external/eigen2 -IC:/CUDA/include -IC:/visdom/external/freeglut-2.6.0/include -IC:/visdom/external/boost-extension “-IC:/Program Files/Boost/include” -IC:/visdom/external/Cg/include -IC:/visdom/external/jpeg7/include -IC:/visdom/external/shiny/include -IC:/visdom/external/PhysX/Physics/include -IC:/visdom/external/PhysX/PhysXLoader/include -IC:/visdom/external/PhysX/Foundation/include -IC:/visdom/external/PhysX/Cooking/include

compiler cmd line

/Od /I “C:\visdom\build\views\views” /I “C:\visdom\views\views” /I “C:\visdom\build\views\views\src\xsd” /I “C:\visdom\core” /I “C:\visdom\build\core\server\src\xsd” /I “C:\visdom\build\core\dataflow\src\xsd” /I “C:\visdom\build\core\datastructures\src\xsd” /I “C:\visdom\build\core\utils\src\xsd” /I “C:\Program Files (x86)\CodeSynthesis XSD 3.3\include” /I “C:\visdom\external\eigen2” /I “C:\CUDA\include” /I “C:\visdom\external\freeglut-2.6.0\include” /I “C:\visdom\external\boost-extension” /I “C:\Program Files\Boost\include” /I “C:\visdom\external\Cg\include” /I “C:\visdom\external\jpeg7\include” /I “C:\visdom\external\shiny\include” /I “C:\visdom\external\PhysX\Physics\include” /I “C:\visdom\external\PhysX\PhysXLoader\include” /I “C:\visdom\external\PhysX\Foundation\include” /I “C:\visdom\external\PhysX\Cooking\include” /D “WIN32” /D “_WINDOWS” /D “_DEBUG” /D “NOMINMAX” /D “WIN32_LEAN_AND_MEAN” /D “_WIN32_WINNT=0x0501” /D “CMAKE_INTDIR="Debug"” /D “views_EXPORTS” /D “_WINDLL” /D “_MBCS” /FD /EHsc /RTC1 /MDd /Fo"views.dir\Debug\" /Fd"C:\visdom\build\bin\Debug/views.pdb" /W3 /nologo /c /Zi /TP /wd4251 /errorReport:prompt

Hello,

I don’t have the answer but I’m trying to make a cuda dll too…
Is there any option to configure in the cuda build rule in order to export a cuda dll?

Thanks for your answer.

Ok I have found the answer for creating a dll there is a video tutorial here :

[url=“The Official NVIDIA Forums | NVIDIA”]http://forums.nvidia.com/index.php?showtopic=97928[/url]

Hope that will help ;)