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