在我代碼進行編譯的時候發現如下情況:
$ 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++ 即可