andrewssobral / bgslibrary

A C++ Background Subtraction Library with wrappers for Python, MATLAB, Java and GUI on QT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not build bgslibrary as a static library

GuruRajan2211 opened this issue · comments

commented

[ 95%] Built target bgslibrary_core
[ 96%] Linking CXX executable bgslibrary
libbgslibrary_core.a(KNN.cpp.o): In function bgslibrary::algorithms::KNN::process(cv::Mat const&, cv::Mat&, cv::Mat&)': KNN.cpp:(.text+0x12d8): undefined reference to cv::createBackgroundSubtractorKNN(int, double, bool)'
libbgslibrary_core.a(MixtureOfGaussianV2.cpp.o): In function bgslibrary::algorithms::MixtureOfGaussianV2::process(cv::Mat const&, cv::Mat&, cv::Mat&)': MixtureOfGaussianV2.cpp:(.text+0xea0): undefined reference to cv::createBackgroundSubtractorMOG2(int, double, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/bgslibrary.dir/build.make:214: recipe for target 'bgslibrary' failed
make[2]: *** [bgslibrary] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/bgslibrary.dir/all' failed
make[1]: *** [CMakeFiles/bgslibrary.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Hello @naruto-uzumakki , sorry for my delayed feedback.
I just released a new version of the BGSLibrary, now v3.1.0. I fixed a lot of issues on this release.
I tested it on Windows, Mac and Linux, both compiling the C++ library on OpenCV 3.4.7, 3.4.16 and 4.6.0.
I also tested its respective Python wrapper and GT user interface.
If you have OpenCV 3 or 4 installed and Python higher than 3.6 (+numpy package):

git clone --recursive https://github.com/andrewssobral/bgslibrary.git
cd bgslibrary/build
cmake .. -DBGS_PYTHON_SUPPORT=ON -DBGS_CORE_STATIC=ON
make -j $(nproc)

Note: at the end you will see some warnings, but it will generate the bgslibrary executable + libbgslibrary_core.a + pybgs.cpython-39-darwin.so (python module to be added in your PYTHONPATH environment variable)
Everything is working for me, could you please check in your side if this new version fix your issues?
Thanks in advance,
Andrews