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

building project "bgs_python.vcxproj" -- FAILED (WIN10)

dhalnon opened this issue · comments

When using the provided build/install script after modifying it to work with my system and what I already have installed, VS2022 returns 2 nearly identical errors
Severity Code Description Project File Line Suppression State Details Error LNK1181 cannot open input file 'opencv_calib3d.lib' bgs_python D:\bgslibrary\build_win_ocv490\LINK 1
and
Severity Code Description Project File Line Suppression State Details Error LNK1181 cannot open input file 'opencv_calib3d.lib' bgslibrary D:\bgslibrary\build_win_ocv490\LINK 1

full build output:

1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>1>Checking Build System
2>------ Build started: Project: bgslibrary_core, Configuration: Release x64 ------
2>Building Custom Rule D:/bgslibrary/CMakeLists.txt
2>AdaptiveBackgroundLearning.cpp
2>AdaptiveSelectiveBackgroundLearning.cpp
2>D:\bgslibrary\bgslibrary\algorithms\AdaptiveSelectiveBackgroundLearning.cpp(60,91): warning C4244: '=': conversion from 'double' to '_Tp', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\AdaptiveSelectiveBackgroundLearning.cpp(60,91): warning C4244:         with
2>D:\bgslibrary\bgslibrary\algorithms\AdaptiveSelectiveBackgroundLearning.cpp(60,91): warning C4244:         [
2>D:\bgslibrary\bgslibrary\algorithms\AdaptiveSelectiveBackgroundLearning.cpp(60,91): warning C4244:             _Tp=float
2>D:\bgslibrary\bgslibrary\algorithms\AdaptiveSelectiveBackgroundLearning.cpp(60,91): warning C4244:         ]
2>CodeBook.cpp
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(92,25): warning C4244: '=': conversion from 'const _Ty' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(92,25): warning C4244:         with
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(92,25): warning C4244:         [
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(92,25): warning C4244:             _Ty=int
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(92,25): warning C4244:         ]
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(93,25): warning C4244: '=': conversion from 'const _Ty' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(93,25): warning C4244:         with
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(93,25): warning C4244:         [
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(93,25): warning C4244:             _Ty=int
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(93,25): warning C4244:         ]
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(159,25): warning C4244: '=': conversion from 'const _Ty' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(159,25): warning C4244:         with
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(159,25): warning C4244:         [
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(159,25): warning C4244:             _Ty=int
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(159,25): warning C4244:         ]
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(160,25): warning C4244: '=': conversion from 'const _Ty' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(160,25): warning C4244:         with
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(160,25): warning C4244:         [
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(160,25): warning C4244:             _Ty=int
2>D:\bgslibrary\bgslibrary\algorithms\CodeBook.cpp(160,25): warning C4244:         ]
2>DPAdaptiveMedian.cpp
2>DPEigenbackground.cpp
2>DPGrimsonGMM.cpp
2>DPMean.cpp
2>DPPratiMediod.cpp
2>DPTexture.cpp
2>DPWrenGA.cpp
2>DPZivkovicAGMM.cpp
2>FrameDifference.cpp
2>FuzzyChoquetIntegral.cpp
2>D:\bgslibrary\bgslibrary\algorithms\FuzzyChoquetIntegral.cpp(149,129): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\FuzzyChoquetIntegral.cpp(149,118): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
2>FuzzySugenoIntegral.cpp
2>D:\bgslibrary\bgslibrary\algorithms\FuzzySugenoIntegral.cpp(148,128): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\FuzzySugenoIntegral.cpp(148,117): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
2>GMG.cpp
2>IMBS.cpp
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(24,49): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(49,29): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(57,26): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(60,17): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(61,16): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(62,17): warning C4244: '=': conversion from 'double' to 'uchar', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(63,17): warning C4244: '=': conversion from 'double' to 'uchar', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(202,26): warning C4244: '=': conversion from 'double' to 'unsigned long', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(214,28): warning C4244: '=': conversion from 'double' to 'unsigned long', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(262,26): warning C4244: '=': conversion from 'int' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(263,26): warning C4244: '=': conversion from 'const _Ty' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(263,26): warning C4244:         with
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(263,26): warning C4244:         [
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(263,26): warning C4244:             _Ty=int
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(263,26): warning C4244:         ]
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(316,67): warning C4018: '<=': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(317,65): warning C4018: '<=': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(318,65): warning C4018: '<=': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(413,21): warning C4244: '*=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(414,25): warning C4244: '*=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(472,41): warning C4244: '+=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(507,46): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(702,19): warning C4244: '/=': conversion from 'double' to 'unsigned int', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\IMBS\IMBS.cpp(703,23): warning C4244: '/=': conversion from 'double' to 'unsigned int', possible loss of data
2>IndependentMultimodal.cpp
2>KDE.cpp
2>KernelTable.cpp
2>NPBGSubtractor.cpp
2>Generating Code...
2>Compiling...
2>NPBGmodel.cpp
2>KNN.cpp
2>LBAdaptiveSOM.cpp
2>LBFuzzyAdaptiveSOM.cpp
2>LBFuzzyGaussian.cpp
2>LBMixtureOfGaussians.cpp
2>LBP_MRF.cpp
2>MEDefs.cpp
2>MEHistogram.cpp
2>MEImage.cpp
2>MotionDetection.cpp
2>graph.cpp
2>maxflow.cpp
2>BackgroundSubtractorLBSP.cpp
2>BackgroundSubtractorLBSP_.cpp
2>BackgroundSubtractorLOBSTER.cpp
2>BackgroundSubtractorPAWCS.cpp
2>D:\bgslibrary\bgslibrary\algorithms\LBSP\BackgroundSubtractorPAWCS.cpp(92,35): warning C4244: 'initializing': conversion from 'const float' to 'size_t', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\LBSP\BackgroundSubtractorPAWCS.cpp(59,77): warning C4244: '=': conversion from 'float' to 'size_t', possible loss of data
2>BackgroundSubtractorSuBSENSE.cpp
2>LBSP.cpp
2>LBSP_.cpp
2>Generating Code...
2>Compiling...
2>LBSimpleGaussian.cpp
2>LOBSTER.cpp
2>MixtureOfGaussianV1.cpp
2>MixtureOfGaussianV2.cpp
2>MultiCue.cpp
2>MultiLayer.cpp
2>BlobExtraction.cpp
2>BlobResult.cpp
2>CMultiLayerBGS.cpp
2>LocalBinaryPattern.cpp
2>blob.cpp
2>PAWCS.cpp
2>PBAS.cpp
2>PixelBasedAdaptiveSegmenter.cpp
2>D:\bgslibrary\bgslibrary\algorithms\PixelBasedAdaptiveSegmenter.cpp(8,55): warning C4305: 'initializing': truncation from 'double' to 'float'
2>D:\bgslibrary\bgslibrary\algorithms\PixelBasedAdaptiveSegmenter.cpp(9,20): warning C4305: 'initializing': truncation from 'double' to 'float'
2>SigmaDelta.cpp
2>D:\bgslibrary\bgslibrary\algorithms\SigmaDelta.cpp(25,111): warning C4267: 'argument': conversion from 'size_t' to 'const uint32_t', possible loss of data
2>sdLaMa091.cpp
2>StaticFrameDifference.cpp
2>SuBSENSE.cpp
2>MRF.cpp
2>T2FGMM.cpp
2>Generating Code...
2>Compiling...
2>T2FMRF.cpp
2>T2FGMM_UM.cpp
2>T2FGMM_UV.cpp
2>T2FMRF_UM.cpp
2>T2FMRF_UV.cpp
2>TwoPoints.cpp
2>two_points.cpp
2>ViBe.cpp
2>vibe-background-sequential.cpp
2>D:\bgslibrary\bgslibrary\algorithms\ViBe\vibe-background-sequential.cpp(238,29): warning C4018: '<': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\ViBe\vibe-background-sequential.cpp(298,65): warning C4018: '>': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\ViBe\vibe-background-sequential.cpp(308,59): warning C4018: '<=': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\ViBe\vibe-background-sequential.cpp(330,78): warning C4018: '<=': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\ViBe\vibe-background-sequential.cpp(559,28): warning C4018: '<': signed/unsigned mismatch
2>D:\bgslibrary\bgslibrary\algorithms\ViBe\vibe-background-sequential.cpp(727,23): warning C4018: '<': signed/unsigned mismatch
2>VuMeter.cpp
2>TBackground.cpp
2>TBackgroundVuMeter.cpp
2>D:\bgslibrary\bgslibrary\algorithms\VuMeter\TBackgroundVuMeter.cpp(118,19): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>D:\bgslibrary\bgslibrary\algorithms\VuMeter\TBackgroundVuMeter.cpp(119,19): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>D:\bgslibrary\bgslibrary\algorithms\VuMeter\TBackgroundVuMeter.cpp(120,19): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>WeightedMovingMean.cpp
2>WeightedMovingVariance.cpp
2>MyBGS.cpp
2>algorithms.cpp
2>AdaptiveMedianBGS.cpp
2>Eigenbackground.cpp
2>Error.cpp
2>GrimsonGMM.cpp
2>Generating Code...
2>Compiling...
2>Image.cpp
2>MeanBGS.cpp
2>PratiMediodBGS.cpp
2>TextureBGS.cpp
2>WrenGA.cpp
2>ZivkovicAGMM.cpp
2>BGModel.cpp
2>BGModelFuzzyGauss.cpp
2>BGModelFuzzySom.cpp
2>D:\bgslibrary\bgslibrary\algorithms\lb\BGModelFuzzySom.cpp(248,49): warning C4244: '=': conversion from 'double' to 'unsigned char', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\lb\BGModelFuzzySom.cpp(249,51): warning C4244: '=': conversion from 'double' to 'unsigned char', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\lb\BGModelFuzzySom.cpp(250,50): warning C4244: '=': conversion from 'double' to 'unsigned char', possible loss of data
2>BGModelGauss.cpp
2>BGModelMog.cpp
2>BGModelSom.cpp
2>D:\bgslibrary\bgslibrary\algorithms\lb\BGModelSom.cpp(236,49): warning C4244: '=': conversion from 'double' to 'unsigned char', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\lb\BGModelSom.cpp(237,51): warning C4244: '=': conversion from 'double' to 'unsigned char', possible loss of data
2>D:\bgslibrary\bgslibrary\algorithms\lb\BGModelSom.cpp(238,50): warning C4244: '=': conversion from 'double' to 'unsigned char', possible loss of data
2>ForegroundMaskAnalysis.cpp
2>FuzzyUtils.cpp
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(40,23): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(50,23): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(60,23): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(70,23): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(82,25): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(95,25): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(108,25): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(121,25): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\FuzzyUtils.cpp(136,27): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>PerformanceUtils.cpp
2>D:\bgslibrary\bgslibrary\tools\PerformanceUtils.cpp(252,10): warning C4244: 'return': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\PerformanceUtils.cpp(372,11): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
2>PixelUtils.cpp
2>D:\bgslibrary\bgslibrary\tools\PixelUtils.cpp(43,72): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\PixelUtils.cpp(46,58): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\PixelUtils.cpp(49,84): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\PixelUtils.cpp(331,32): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\PixelUtils.cpp(332,38): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>D:\bgslibrary\bgslibrary\tools\PixelUtils.cpp(333,38): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
2>Generating Code...
2>bgslibrary_core.vcxproj -> D:\bgslibrary\build_win_ocv490\bgslibrary_core.lib
2>Done building project "bgslibrary_core.vcxproj".
3>------ Build started: Project: bgslibrary, Configuration: Release x64 ------
4>------ Build started: Project: bgs_python, Configuration: Release x64 ------
3>Building Custom Rule D:/bgslibrary/CMakeLists.txt
3>FrameProcessor.cpp
4>Building Custom Rule D:/bgslibrary/CMakeLists.txt
4>bgslibrary_module.cpp
4>ndarray_converter.cpp
3>Main.cpp
3>PreProcessor.cpp
3>VideoAnalysis.cpp
4>LINK : fatal error LNK1181: cannot open input file 'opencv_calib3d.lib'
4>Done building project "bgs_python.vcxproj" -- FAILED.
3>VideoCapture.cpp
3>D:\bgslibrary\bgslibrary\VideoCapture.cpp(147,19): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
3>D:\bgslibrary\bgslibrary\VideoCapture.cpp(247,25): warning C4244: 'argument': conversion from 'double' to 'int', possible loss of data
3>Generating Code...
3>LINK : fatal error LNK1181: cannot open input file 'opencv_calib3d.lib'
3>Done building project "bgslibrary.vcxproj" -- FAILED.
5>------ Build started: Project: ALL_BUILD, Configuration: Release x64 ------
5>Building Custom Rule D:/bgslibrary/CMakeLists.txt
6>------ Skipped Build: Project: INSTALL, Configuration: Release x64 ------
6>Project not selected to build for this solution configuration 
========== Build: 3 succeeded, 2 failed, 0 up-to-date, 1 skipped ==========
========== Build completed at 4:49 PM and took 01:59.397 minutes ==========```

I've attempted rebuilding OpenCV and confirmed that the calib3d module is successfully installed

Windows 10 Pro Build 19045
OpenCV 4.9.0-dev
Tried with both Python 3.11 and 3.12

Solved with some experimentation. Issue seems to be passing BUILD_opencv_world=ON arg to cmake when building opencv. Switched this to off and bgslibrary installed without errors

Great, thank you @dhalnon for your feedback !