/usr/bin/ld: error when run ./build.sh after compiling opencv2.4.10 on ubuntu12.04

I had tried to run ./build.sh(in ~/sample/c), but I get such errors

compiling adaptiveskindetector.cpp
/usr/bin/ld: error: cannot find -lcufft
/usr/bin/ld: error: cannot find -lnpps
/usr/bin/ld: error: cannot find -lnppi
/usr/bin/ld: error: cannot find -lnppc
collect2: ld returned 1 exit status


my solution for this:

make a symbolic link to libcuda where ld is searching it

sudo ln -s /usr/local/cuda/lib64/libnpps.so /usr/lib/libnpps.so

sudo ln -s /usr/local/cuda/lib64/libnppi.so /usr/lib/libnppi.so

sudo ln -s /usr/local/cuda/lib64/libnppc.so /usr/lib/libnppc.so

sudo ln -s /usr/local/cuda/lib64/libcufft.so /usr/lib/libcufft.so

sudo ln -s /usr/local/cuda/lib64/libcudart.so /usr/lib/libcudart.so

sudo ldconfig


After created the links, the errors all gone. Wish this useful for other people!

你可能感兴趣的:(/usr/bin/ld: error when run ./build.sh after compiling opencv2.4.10 on ubuntu12.04)