Hi, Here is my problem, I try to create a static lib in one of my VS projects :
+ RSolution
|--+ RCuda => Static .lib
| -- RCUTest.h
| -- RCUTest.cu
|--+ RApp => .exe linking RCuda
| -- main.cpp
My Cuda code is Really simple :
RCUTest.h
extern "C" void runTestCuda();
RCUTest.cu
#include "RCUTest.h"
extern "C" void runTestCuda() {};
main.cpp
int main (int argc, char **argv)
{runTestCuda();}
Here are the CMake command lines (.lib):
CUDA_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR})
CUDA_INCLUDE_DIRECTORIES( ${CUDA_CUT_INCLUDE} )
CUDA_ADD_LIBRARY(RCuda RCUTest.cu RCUTest.h)
(.exe) :
ADD_EXECUTABLE( RApp main.cpp)
TARGET_LINK_LIBRARIES(RApp RCuda)
Building&linking RCuda works fine, but when linking RApp, I get the following error message :
main.obj : error LNK2019: symbole externe non résolu _runTestCuda référencé dans la fonction ...
In English it is something like : error LNK2019: unresolved external symbol _runTestCuda referenced in function …
I’ve opened the generated file RCuda.lib, and it contains _runTestCuda
I’ve checked RCuda.lib is well included in RApp generation command line.
I’m becoming mad … <img src=‘http://hqnveipbwb20/public/style_emoticons/<#EMO_DIR#>/crying.gif’ class=‘bbc_emoticon’ alt=‘:’(’ />
A big big thank to the one who solves the problem.