RaulRB Posted February 2, 2017 Share Posted February 2, 2017 Hi friends, I am trying to make an app with opencv in SDSoC but it isn`t working. The code that i am using is this ( simple code to do a simple hello world): #ifdef USE_OPENCV #include <opencv2/opencv.hpp> #endif #include <iostream> using namespace std; #ifdef USE_OPENCV using namespace cv; #endif int main() { #ifdef USE_OPENCV Mat im,gris; im = imread("lena.jpg"); cvtColor(im, gris, COLOR_RGB2GRAY); imwrite("Gris.jpg",gris); waitKey(0); #endif return 0; } If i don't use de ifdefs it has few problems like this: G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:17: undefined reference to `cv::imread(std::string const&, int)' G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:18: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:18: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:18: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:19: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:19: undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:20: undefined reference to `cv::waitKey(int)' G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o: In function `cv::Mat::~Mat()': C:/Xilinx/SDSoC/2016.2/Vivado_HLS/2016.2/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)' G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o: In function `cv::Mat::operator=(cv::Mat const&)': C:/Xilinx/SDSoC/2016.2/Vivado_HLS/2016.2/include/opencv2/core/mat.hpp:298: undefined reference to `cv::Mat::copySize(cv::Mat const&)' G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o: In function `cv::Mat::release()': C:/Xilinx/SDSoC/2016.2/Vivado_HLS/2016.2/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()' collect2.exe: error: ld returned 1 exit status ERROR: [SDSoC 0-0] Exiting sds++ : Error when calling 'arm-linux-gnueabihf-g++ G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs/devreg.o G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs/portinfo.o -L C:/Xilinx/SDSoC/2016.2/aarch32-linux/lib -LG:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs -Wl,--start-group -Wl,--end-group -Wl,--start-group -lpthread -lsds_lib -lxlnk_stub -Wl,--end-group -o G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs/PlataformaOpenCV.elf' sds++ log file saved as G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/reports/sds.log ERROR: [SDSoC 0-0] Build failed Can you help me please? Thanks, Raúl Link to comment Share on other sites More sharing options...
jpeyron Posted February 2, 2017 Share Posted February 2, 2017 Hi Raul, Unfortunately I do not have much experience with SDSOC. Hopefully some of the more experienced community members can better help you. I have found some documentation that might help. Here and here are xilinx's SDSOC page. Here is a xilinx forum question dealing with SDSOC 2016.2 and OpenCV. thank you, Jon Link to comment Share on other sites More sharing options...
RaulRB Posted February 2, 2017 Author Share Posted February 2, 2017 Thanks for the response Jon, In fact I had been revised this link's few days ago. The link from the Xilinx forum has examples for the zc702. I downloaded the example and compile in SDSoC, but I don't have this board and can't try it. The example uses the " ifdef opencv " sections for the opencv code. But I don't know if it works I wrote the rest of the history in my previous post. Regards, Raúl Link to comment Share on other sites More sharing options...
Question
RaulRB
Hi friends,
I am trying to make an app with opencv in SDSoC but it isn`t working.
The code that i am using is this ( simple code to do a simple hello world):
#ifdef USE_OPENCV
#include <opencv2/opencv.hpp>
#endif
#include <iostream>
using namespace std;
#ifdef USE_OPENCV
using namespace cv;
#endif
int main() {
#ifdef USE_OPENCV
Mat im,gris;
im = imread("lena.jpg");
cvtColor(im, gris, COLOR_RGB2GRAY);
imwrite("Gris.jpg",gris);
waitKey(0);
#endif
return 0;
}
If i don't use de ifdefs it has few problems like this:
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:17: undefined reference to `cv::imread(std::string const&, int)'
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:18: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:18: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:18: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:19: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:19: undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
G:/ProyetoFinalIAH/PlataformaOpenCV/src/main.cpp:20: undefined reference to `cv::waitKey(int)'
G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o: In function `cv::Mat::~Mat()':
C:/Xilinx/SDSoC/2016.2/Vivado_HLS/2016.2/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o: In function `cv::Mat::operator=(cv::Mat const&)':
C:/Xilinx/SDSoC/2016.2/Vivado_HLS/2016.2/include/opencv2/core/mat.hpp:298: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o: In function `cv::Mat::release()':
C:/Xilinx/SDSoC/2016.2/Vivado_HLS/2016.2/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
collect2.exe: error: ld returned 1 exit status
ERROR: [SDSoC 0-0] Exiting sds++ : Error when calling 'arm-linux-gnueabihf-g++ G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/src/main.o G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs/devreg.o G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs/portinfo.o -L C:/Xilinx/SDSoC/2016.2/aarch32-linux/lib -LG:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs -Wl,--start-group -Wl,--end-group -Wl,--start-group -lpthread -lsds_lib -lxlnk_stub -Wl,--end-group -o G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/swstubs/PlataformaOpenCV.elf'
sds++ log file saved as G:/ProyetoFinalIAH/PlataformaOpenCV/SDDebug/_sds/reports/sds.log
ERROR: [SDSoC 0-0] Build failed
Can you help me please?
Thanks,
Raúl
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.