在我代码进行编译的时候发现如下情况:
$ gcc test.cpp -o test `pkg-config --cflags --libs opencv`
报错:
/usr/bin/ld: /tmp/ccSHkr4u.o: undefined reference to symbol ‘_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3‘
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
问题
使用了c++的环境,所以要用g++编译:
gcc改成g++ 即可