【bug记录】opencv opencl 编译失败

报错

/usr/bin/ld: /tmp/ccKc0i2H.o: undefined reference to symbol '_ZNSaIcED1Ev@@GLIBCXX_3.4'
/usr/bin/ld: /lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

解决方法

问题在于使用的是gcc来进行编译

gcc main.cpp -o main $(pkg-config --cflags --libs opencv) -lOpenCL

修改为

g++ main.cpp -o main $(pkg-config --cflags --libs opencv) -lOpenCL

即可

猜你喜欢

转载自blog.csdn.net/peterwanye/article/details/129622033
今日推荐