Hi,
I am trying to compile cuda-bgs in linux.
I have commented out 2-3 lines of code that used “conio.h” which is not portable.
If i try to compile with nvcc the main.cpp it says that it can not link the cuda functions.
If i rename it to main.cu i get the following error:
http://tech.groups.yahoo.com/group/OpenCV/message/81513
Any Ideas how to overcome this?
If i comment out an include line in the cuFastBG…ver5.cu file i can do:
nvcc -c cuFastBG…ver5.cu and end up with an .o file .
Then i use the following command:
g++ CvFastBgGMM_ver5.o main.cpp -o loadimg -I"/usr/include/opencv" -lcxcore -lcv -lhighgui -lcuda -I"/usr/local/cuda/include" -L/usr/local/cuda/lib64 -lcudart
but it produces:
main.cpp:(.text+0x105): undefined reference to cvCreateFastBgGMMParams(int, int)' main.cpp:(.text+0x127): undefined reference to
cvCreateFastBgGMM(CvFastBgGMMParams*, _IplImage*)’
main.cpp:(.text+0x162): undefined reference to cvUpdateFastBgGMMTimer(CvFastBgGMM*, _IplImage*)' main.cpp:(.text+0x2bc): undefined reference to
cvReleaseFastBgGMM(CvFastBgGMM**)’
if i try and compile main.cpp with g++ it succedes,if i compile the .cu file with nvcc it also succedes.
But if i try:
g++ main.o CvFastBgGMM_ver5.o -I"/usr/include/opencv" -lcxcore -lcv -lhighgui -lcuda -I"/usr/local/cuda/include" -L/usr/local/cuda/lib64 -lcudart
I get the exact same error.
I am attaching you my modified version so you can have a look.
Thank you for your time.
Apostolis
CvFastBgGMM.h (7.8 KB)
CvFastBgGMM_ver5.cu (21.3 KB)
main.cpp (2.29 KB)