编译过程:
g++ -std=c++11 2.cpp $LD_LIBRARY_PATH/libbgslibrary_core.so `pkg-config --cflags --libs opencv`
错误:
undefined reference to `bgslibrary::algorithms::FrameDifference::FrameDifference()
解决:
1If you are compiling in Linux OS, then (after install the library): 2 3Assuming that the libbgslibrary_core.so file is located in /usr/local/lib 4 5====================================================== 6 7To solve this temporarily (only in this bash session): 8$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib 9$ export LD_LIBRARY_PATH 10 11====================================================== 12 13To solve this permanent: 14$ sudo echo 'export LD_LIBRARY_PATH=/usr/local/lib' >> ~/.bashrc 15 16====================================================== 17 18And to compile your program include this flag: $LD_LIBRARY_PATH/libbgslibrary_core.so 19 20It should be like: $ g++ -std=c++14 Demo.cpp $LD_LIBRARY_PATH/libbgslibrary_core.so `pkg-config --cflags --libs opencv`