Hi,
i have some problems to get my project correctly linked and running.
Those are the files and content involved.
//app.cpp
#include "lib.h"
void main()
{
start();
}
//lib.h
void start();
//lib.cpp
#include "lib.h"
#include "cudalib.h"
void start()
{
startCudaKernel ();
}
//cudalib.h
void startCudaKernel();
//cudalib.cu
extern "C"
void startCudaKernel()
{
//start a cuda kernel etc.
}
//cmakelists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(CuCo)
FIND_PACKAGE(Cuda REQUIRED)
FILE(GLOB cudasrc "cudalib.cu" "cudalib.h")
CUDA_ADD_LIBRARY(cudalib ${cudasrc})
FILE(GLOB libsrc "lib.cpp" "lib.h")
ADD_LIBRARY(liby ${libsrc})
TARGET_LINK_LIBRARIES(liby cudalib)
FILE(GLOB appsrc "app.cpp")
ADD_EXECUTABLE(app ${appsrc})
TARGET_LINK_LIBRARIES(app liby)
And i am using vs2010 and i know that i have to change the toolset to
vc90(any idea to let cmake set this btw?)
I always get an linker error telling me that "startCudaKernel" is not
resolved. I have no idea why this error occures. Everything builds fine,
even nvcc tells me that everything is correct. Only the linker has a problem
to link everything.
Regards and Thanks for your help.
Basti
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake