# opencv in jetsontk1 

**URL:** <https://forums.developer.nvidia.com/t/opencv-in-jetsontk1/48804>\
**Category:** Jetson TK1\
**Created:** [March 27, 2017, 12:21pm UTC](https://forums.developer.nvidia.com/t/opencv-in-jetsontk1/48804 "2017-03-27T12:21:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohamed\_cmc](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Mohamed\_cmc](https://forums.developer.nvidia.com/u/Mohamed_cmc)\
**Post date:** [March 27, 2017, 12:21pm UTC](https://forums.developer.nvidia.com/t/opencv-in-jetsontk1/48804/1 "2017-03-27T12:21:24Z")

</div>

hello everyone,

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

```auto
#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 :

```auto
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

---

<div class="post-metadata">

**Author:** ![Mohamed\_cmc](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Mohamed\_cmc](https://forums.developer.nvidia.com/u/Mohamed_cmc)\
**Post date:** [March 27, 2017, 12:34pm UTC](https://forums.developer.nvidia.com/t/opencv-in-jetsontk1/48804/2 "2017-03-27T12:34:13Z")

</div>

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/](https://devtalk.nvidia.com/default/topic/793707/compiling-an-opencv-file-some-libraries-are-not-found/)

---

<div class="post-metadata">

**Author:** ![PatriciaNavarroMartin](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@PatriciaNavarroMartin](https://forums.developer.nvidia.com/u/PatriciaNavarroMartin)\
**Post date:** [April 14, 2017, 5:01pm UTC](https://forums.developer.nvidia.com/t/opencv-in-jetsontk1/48804/3 "2017-04-14T17:01:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 6:45pm UTC](https://forums.developer.nvidia.com/t/opencv-in-jetsontk1/48804/4 "2021-10-18T18:45:20Z")

</div>

Closed on October 18, 2021, 6:45pm UTC


