Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Raspbian Build error with opencv

Hello everybody!

I have a Raspberry PI 3B with installed Rasbian OS on SD card. I installed Opencv 4.2.0 on my device, but when I would like to Build an example I become some errors: displayimage.cpp:(.text+0x3c): undefined reference to cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)' /usr/bin/ld: displayimage.cpp:(.text+0x9c): undefined reference tocv::imshow(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, cv::_InputArray const&)' /usr/bin/ld: displayimage.cpp:(.text+0xc8): undefined reference to `cv::waitKey(int)' ... My C++ code is very simple:

include <iostream>

include "opencv2/opencv.hpp"

using namespace cv; using namespace std;

int main(){ Mat img=imread("car.jpeg"); imshow("Car image", img); waitKey(0); return 0; } I checked the include files, and I made an simbolic link for opencv include files, so the compiler can see the header files. I checked also the lib, and bin files, I see everything is ok. I dont know what schould I do now. I dont have any idea. Can you help my?

Thanks

click to hide/show revision 2
None

updated 2020-01-15 04:24:23 -0600

berak gravatar image

Raspbian Build error with opencv

Hello everybody!

I have a Raspberry PI 3B with installed Rasbian OS on SD card. I installed Opencv 4.2.0 on my device, but when I would like to Build an example I become some errors: errors:

displayimage.cpp:(.text+0x3c): undefined reference to cv::imread(std::__cxx11::basic_string<char, `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: displayimage.cpp:(.text+0x9c): undefined reference tocv::imshow(std::__cxx11::basic_string<char, std::char_traits<char="">, to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/usr/bin/ld: displayimage.cpp:(.text+0xc8): undefined reference to `cv::waitKey(int)'

... My C++ code is very simple:

include <iostream>

include "opencv2/opencv.hpp"

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

std; int main(){ Mat img=imread("car.jpeg"); imshow("Car image", img); waitKey(0); return 0; }

I checked the include files, and I made an simbolic link for opencv include files, so the compiler can see the header files. I checked also the lib, and bin files, I see everything is ok. I dont know what schould I do now. I dont have any idea. Can you help my?

Thanks

Raspbian Build error with opencv

Hello everybody!

I have a Raspberry PI 3B with installed Rasbian OS on SD card. I installed Opencv 4.2.0 on my device, but when I would like to Build an example I become some errors:

displayimage.cpp:(.text+0x3c): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: displayimage.cpp:(.text+0x9c): undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/usr/bin/ld: displayimage.cpp:(.text+0xc8): undefined reference to `cv::waitKey(int)'

... My C++ code is very simple:

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

int main(){
        Mat img=imread("car.jpeg");
        imshow("Car image", img);
        waitKey(0);
        return 0;
}

I checked the include files, and I made an simbolic link for opencv include files, so the compiler can see the header files. I checked also the lib, and bin files, I see everything is ok. I dont know what schould I do now. I dont have any idea. Can you help my?

Thanks

2020.01.15. 13:07 Now I can with CMAKE file compile the example code. I think I must configure Geany, and the QTCreator to using OpenCV librarys.

Raspbian Build error with opencv

Hello everybody!

I have a Raspberry PI 3B with installed Rasbian OS on SD card. I installed Opencv 4.2.0 on my device, but when I would like to Build an example I become some errors:

displayimage.cpp:(.text+0x3c): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: displayimage.cpp:(.text+0x9c): undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/usr/bin/ld: displayimage.cpp:(.text+0xc8): undefined reference to `cv::waitKey(int)'

... My C++ code is very simple:

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

int main(){
        Mat img=imread("car.jpeg");
        imshow("Car image", img);
        waitKey(0);
        return 0;
}

I checked the include files, and I made an simbolic link for opencv include files, so the compiler can see the header files. I checked also the lib, and bin files, I see everything is ok. I dont know what schould I do now. I dont have any idea. Can you help my?

Thanks

2020.01.15. 13:07 Now I can with CMAKE file compile the example code. I think I must configure Geany, and the QTCreator to using OpenCV librarys.

2020.01.17. Everything is ok! I can use now all my opencv examples.

Raspbian Build error with opencv

Hello everybody!

I have a Raspberry PI 3B with installed Rasbian OS on SD card. I installed Opencv 4.2.0 on my device, but when I would like to Build an example I become some errors:

displayimage.cpp:(.text+0x3c): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: displayimage.cpp:(.text+0x9c): undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/usr/bin/ld: displayimage.cpp:(.text+0xc8): undefined reference to `cv::waitKey(int)'

... My C++ code is very simple:

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

int main(){
        Mat img=imread("car.jpeg");
        imshow("Car image", img);
        waitKey(0);
        return 0;
}

I checked the include files, and I made an simbolic link for opencv include files, so the compiler can see the header files. I checked also the lib, and bin files, I see everything is ok. I dont know what schould I do now. I dont have any idea. Can you help my?

Thanks

2020.01.15. 13:07 Now I can with CMAKE file compile the example code. I think I must configure Geany, and the QTCreator to using OpenCV librarys.

2020.01.17. Everything is ok! I can use now all my opencv examples.