Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Linking staticlib in mvs2013 release gives external errors

I have multiple errors LNK2001: unresolved external symbol error "opencv_highgui2413.lib(cap_vfw.obj) when i try to use the staticlib folder instead of lib and dlls in mvs2013 windows 10 and release option in project build. The statilib i am trying to use is opencv-2.4.13.exe

  • By C/C++ linking the include directory to : D:\OpenCV\build\include
  • By Linker linking the include dependancies to : D:\OpenCV\build\x86\vc12\staticlib And using : No Incremental linking
  • By Linker input additional dependancies entering each one .lib inside the folder of staticlib without "d"
  • By C/C++ using runtime library to : Multi-Threaded(/MT)

Is there anything i do wrong or is it something else ? Windows 10 - mvs2013 - The project i create to test is only a VideoCapture webcam test

My Test project is working fine if i dont use the staticlib and use the lib with dlls but since i want a staticlib i test it with the above linkings of opencv and it has errors in every function of object opecv_highgui2413.lib

Thanks in advance for any kind of help to solve this issue

Linking staticlib in mvs2013 release gives external errors

I have multiple errors LNK2001: unresolved external symbol error "opencv_highgui2413.lib(cap_vfw.obj) when i try to use the staticlib folder instead of lib and dlls in mvs2013 windows 10 and release option in project build. The statilib i am trying to use is opencv-2.4.13.exe

  • By C/C++ linking the include directory to : D:\OpenCV\build\include
  • By Linker linking the include dependancies to : D:\OpenCV\build\x86\vc12\staticlib And using : No Incremental linking
  • By Linker input additional dependancies entering each one .lib inside the folder of staticlib without "d"
  • By C/C++ using runtime library to : Multi-Threaded(/MT)

Is there anything i do wrong or is it something else ? Windows 10 - mvs2013 - The project i create to test is only a VideoCapture webcam test

My Test project is working fine if i dont use the staticlib and use the lib with dlls but since i want a staticlib i test it with the above linkings of opencv and it has errors in every function of object opecv_highgui2413.lib

Thanks in advance for any kind of help to solve this issue

@LBerger request : @LBerger

  • C/C++ command line /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /I"D:\OpenCV\build\include"/Zi /Gm- /O2 /Fd"Release\vc120.pdb" /fp:precise /D "WIN32" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\TestVideo.pch"

  • LINKER command line /OUT:"D:\TestVideo\Release\TestVideo.exe" /MANIFEST /LTCG /NXCOMPAT /PDB:"D:\TestVideo\Release\TestVideo.pdb" /DYNAMICBASE "opencv_calib3d2413.lib" "opencv_contrib2413.lib" "opencv_core2413.lib" "opencv_features2d2413.lib" "opencv_flann2413.lib" "opencv_gpu2413.lib" "opencv_highgui2413.lib" "opencv_imgproc2413.lib" "opencv_legacy2413.lib" "opencv_ml2413.lib" "opencv_nonfree2413.lib" "opencv_objdetect2413.lib" "opencv_ocl2413.lib" "opencv_photo2413.lib" "opencv_stitching2413.lib" "opencv_superres2413.lib" "opencv_ts2413.lib" "opencv_video2413.lib" "opencv_videostab2413.lib" "IlmImf.lib" "libjasper.lib" "libjpeg.lib" "libpng.lib" "libtiff.lib" "zlib.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"D:\TestVideo\Release\TestVideo.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\TestVideo.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"D:\OpenCV\build\x86\vc12\staticlib" /TLBID:1

Linking staticlib in mvs2013 release gives external errors

I have multiple errors LNK2001: unresolved external symbol error "opencv_highgui2413.lib(cap_vfw.obj) when i try to use the staticlib folder instead of lib and dlls in mvs2013 windows 10 and release option in project build. The statilib i am trying to use is opencv-2.4.13.exe

  • By C/C++ linking the include directory to : D:\OpenCV\build\include
  • By Linker linking the include dependancies to : D:\OpenCV\build\x86\vc12\staticlib And using : No Incremental linking
  • By Linker input additional dependancies entering each one .lib inside the folder of staticlib without "d"
  • By C/C++ using runtime library to : Multi-Threaded(/MT)

Is there anything i do wrong or is it something else ? Windows 10 - mvs2013 - The project i create to test is only a VideoCapture webcam test

My Test project is working fine if i dont use the staticlib and use the lib with dlls but since i want a staticlib i test it with the above linkings of opencv and it has errors in every function of object opecv_highgui2413.lib

Thanks in advance for any kind of help to solve this issue

@LBerger request : @LBerger:

  • C/C++ command line /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /I"D:\OpenCV\build\include"/Zi /Gm- /O2 /Fd"Release\vc120.pdb" /fp:precise /D "WIN32" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\TestVideo.pch"

  • LINKER command line /OUT:"D:\TestVideo\Release\TestVideo.exe" /MANIFEST /LTCG /NXCOMPAT /PDB:"D:\TestVideo\Release\TestVideo.pdb" /DYNAMICBASE "opencv_calib3d2413.lib" "opencv_contrib2413.lib" "opencv_core2413.lib" "opencv_features2d2413.lib" "opencv_flann2413.lib" "opencv_gpu2413.lib" "opencv_highgui2413.lib" "opencv_imgproc2413.lib" "opencv_legacy2413.lib" "opencv_ml2413.lib" "opencv_nonfree2413.lib" "opencv_objdetect2413.lib" "opencv_ocl2413.lib" "opencv_photo2413.lib" "opencv_stitching2413.lib" "opencv_superres2413.lib" "opencv_ts2413.lib" "opencv_video2413.lib" "opencv_videostab2413.lib" "IlmImf.lib" "libjasper.lib" "libjpeg.lib" "libpng.lib" "libtiff.lib" "zlib.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"D:\TestVideo\Release\TestVideo.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\TestVideo.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"D:\OpenCV\build\x86\vc12\staticlib" /TLBID:1

Linking staticlib in mvs2013 release gives external errors

I have multiple errors LNK2001: unresolved external symbol error "opencv_highgui2413.lib(cap_vfw.obj) when i try to use the staticlib folder instead of lib and dlls in mvs2013 windows 10 and release option in project build. The statilib i am trying to use is opencv-2.4.13.exe

  • By C/C++ linking the include directory to : D:\OpenCV\build\include
  • By Linker linking the include dependancies to : D:\OpenCV\build\x86\vc12\staticlib And using : No Incremental linking
  • By Linker input additional dependancies entering each one .lib inside the folder of staticlib without "d"
  • By C/C++ using runtime library to : Multi-Threaded(/MT)

Is there anything i do wrong or is it something else ? Windows 10 - mvs2013 - The project i create to test is only a VideoCapture webcam test

My Test project is working fine if i dont use the staticlib and use the lib with dlls but since i want a staticlib i test it with the above linkings of opencv and it has errors in every function of object opecv_highgui2413.lib

Thanks in advance for any kind of help to solve this issue

@LBerger request :

  • C/C++ command line /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /I"D:\OpenCV\build\include"/Zi /Gm- /O2 /Fd"Release\vc120.pdb" /fp:precise /D "WIN32" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\TestVideo.pch"

  • LINKER command line /OUT:"D:\TestVideo\Release\TestVideo.exe" /MANIFEST /LTCG /NXCOMPAT /PDB:"D:\TestVideo\Release\TestVideo.pdb" /DYNAMICBASE "opencv_calib3d2413.lib" "opencv_contrib2413.lib" "opencv_core2413.lib" "opencv_features2d2413.lib" "opencv_flann2413.lib" "opencv_gpu2413.lib" "opencv_highgui2413.lib" "opencv_imgproc2413.lib" "opencv_legacy2413.lib" "opencv_ml2413.lib" "opencv_nonfree2413.lib" "opencv_objdetect2413.lib" "opencv_ocl2413.lib" "opencv_photo2413.lib" "opencv_stitching2413.lib" "opencv_superres2413.lib" "opencv_ts2413.lib" "opencv_video2413.lib" "opencv_videostab2413.lib" "IlmImf.lib" "libjasper.lib" "libjpeg.lib" "libpng.lib" "libtiff.lib" "zlib.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"D:\TestVideo\Release\TestVideo.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\TestVideo.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"D:\OpenCV\build\x86\vc12\staticlib" /TLBID:1

And Here is the small test which work with dynamic built of openv and not with static maby could help someone to help me out :

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

int main(){

    Mat CamFrame;
    VideoCapture CaptureCam(CV_CAP_ANY);
    ..... alla others not needed cause even with VideoCapture it pops up all errors
    ..... if i remove VideoCapture no errors at all it builds in release mode and static opencv with all libs inside
    return 0; 
}

Linking staticlib in mvs2013 release gives external errors

I have multiple errors LNK2001: unresolved external symbol error "opencv_highgui2413.lib(cap_vfw.obj) when i try to use the staticlib folder instead of lib and dlls in mvs2013 windows 10 and release option in project build. The statilib i am trying to use is opencv-2.4.13.exe

  • By C/C++ linking the include directory to : D:\OpenCV\build\include
  • By Linker linking the include dependancies to : D:\OpenCV\build\x86\vc12\staticlib And using : No Incremental linking
  • By Linker input additional dependancies entering each one .lib inside the folder of staticlib without "d"
  • By C/C++ using runtime library to : Multi-Threaded(/MT)

Is there anything i do wrong or is it something else ? Windows 10 - mvs2013 - The project i create to test is only a VideoCapture webcam test

My Test project is working fine if i dont use the staticlib and use the lib with dlls but since i want a staticlib i test it with the above linkings of opencv and it has errors in every function of object opecv_highgui2413.lib

Thanks in advance for any kind of help to solve this issue

@LBerger request :

  • C/C++ command line /GS /GL /analyze- /W3 /Gy /Zc:wchar_t /I"D:\OpenCV\build\include"/Zi /Gm- /O2 /Fd"Release\vc120.pdb" /fp:precise /D "WIN32" /D "_CONSOLE" /D "_LIB" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MT /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\TestVideo.pch"

  • LINKER command line /OUT:"D:\TestVideo\Release\TestVideo.exe" /MANIFEST /LTCG /NXCOMPAT /PDB:"D:\TestVideo\Release\TestVideo.pdb" /DYNAMICBASE "opencv_calib3d2413.lib" "opencv_contrib2413.lib" "opencv_core2413.lib" "opencv_features2d2413.lib" "opencv_flann2413.lib" "opencv_gpu2413.lib" "opencv_highgui2413.lib" "opencv_imgproc2413.lib" "opencv_legacy2413.lib" "opencv_ml2413.lib" "opencv_nonfree2413.lib" "opencv_objdetect2413.lib" "opencv_ocl2413.lib" "opencv_photo2413.lib" "opencv_stitching2413.lib" "opencv_superres2413.lib" "opencv_ts2413.lib" "opencv_video2413.lib" "opencv_videostab2413.lib" "IlmImf.lib" "libjasper.lib" "libjpeg.lib" "libpng.lib" "libtiff.lib" "zlib.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"D:\TestVideo\Release\TestVideo.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"Release\TestVideo.exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"D:\OpenCV\build\x86\vc12\staticlib" /TLBID:1

And Here is the small test which work with dynamic built of openv and not with static maby could help someone to help me out :

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

int main(){

    Mat CamFrame;
    VideoCapture CaptureCam(CV_CAP_ANY);
    ..... alla others not needed cause even with VideoCapture it pops up all errors
    ..... if i remove VideoCapture no errors at all it builds in release mode and static opencv with all libs inside
    return 0; 
}

@LBerger yes it builds it without errors but it doesn`t show the image at all, it opens the window and stays with gray backroung and no image is loaded inside, the image is on the same folder with my executable so it has something to do with the highgui.lib in static build.

The basic reason i want to use OpenCV is for capturing the video cam and encode it. Errors when i use VideoCapture cap(0); that doesn`t even compile :

  • Error 5 error LNK2001: unresolved external symbol _ICSendMessage@16 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 3 error LNK2001: unresolved external symbol _ICOpen@12 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 6 error LNK2001: unresolved external symbol _ICDecompress D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 4 error LNK2001: unresolved external symbol _ICClose@4 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 22 error LNK2001: unresolved external symbol _capGetDriverDescriptionA@20 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 21 error LNK2001: unresolved external symbol _capCreateCaptureWindowA@32 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 15 error LNK2001: unresolved external symbol _AVIStreamWrite@32 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 14 error LNK2001: unresolved external symbol _AVIStreamSetFormat@16 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 12 error LNK2001: unresolved external symbol _AVIStreamRelease@4 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 13 error LNK2001: unresolved external symbol _AVIStreamInfoA@12 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 16 error LNK2001: unresolved external symbol _AVIStreamGetFrameOpen@8 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 18 error LNK2001: unresolved external symbol _AVIStreamGetFrameClose@4 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 17 error LNK2001: unresolved external symbol _AVIStreamGetFrame@8 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 20 error LNK2001: unresolved external symbol _AVISaveOptions@20 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 19 error LNK2001: unresolved external symbol _AVIMakeCompressedStream@16 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 8 error LNK2001: unresolved external symbol _AVIFileRelease@4 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 9 error LNK2001: unresolved external symbol _AVIFileOpenA@16 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 7 error LNK2001: unresolved external symbol _AVIFileInit@0 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 10 error LNK2001: unresolved external symbol _AVIFileGetStream@16 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo
  • Error 11 error LNK2001: unresolved external symbol _AVIFileCreateStreamA@12 D:\TestVideo\opencv_highgui2413.lib(cap_vfw.obj) TestVideo