opencv in jetsontk1

hello everyone,

i got error when i try to compile this code in jetson tk1:

#include <opencv2/opencv.hpp>
#include <time.h>
#include <stdio.h>
using namespace cv;

int main() {
Mat src = imread("mini.jpg", 0);
if (!src.data) exit(1);
Mat dst;
clock_t begin = clock();

bilateralFilter(src, dst, -1, 50, 7);
Canny(dst, dst, 35, 200, 3);

clock_t end = clock();
imwrite("out.png", dst);
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;

printf("time=%f\n",time_spent);
return 0;
}

this is the error which i got :

ubuntu@tegra-ubuntu:~/Templates/opencv$ g++ cpu.c -o cpu `pkg-config opencv --cflags --libs`
/usr/bin/ld: cannot find -lcufft
/usr/bin/ld: cannot find -lnpps
/usr/bin/ld: cannot find -lnppi
/usr/bin/ld: cannot find -lnppc
/usr/bin/ld: cannot find -lcudart
collect2: error: ld returned 1 exit status
ubuntu@tegra-ubuntu:~/Templates/opencv$

Thanks

i solved by adding this line:

-L/usr/local/cuda-6.5/lib

you can fine the complete answer in this link:

https://devtalk.nvidia.com/default/topic/793707/compiling-an-opencv-file-some-libraries-are-not-found/

A related question:
Do you compile with the Nsight Eclipse and libraries found in the Jetson or do you cross-compile it remotely with these found in the host?