无法导入外部库

时间:2015-07-10 08:29:37

标签: c++ opencv visual-studio-2013

我跟踪link中的说明。我下载了存储库。然后,我应用了这些命令:

cd C:\OpenCV3.0.0\opencv\build 
cmake -DOPENCV_EXTRA_MODULES_PATH=C:\opencv_contrib-master\modules C:\OpenCV3.0.0\opencv\sources

它会创建一个包含大量错误的CMakeError.txt文件。

相关部分:

Build FAILED.

"C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_93c95.vcxproj" (default target) (1) ->

(Link target) -> 

  CheckFunctionExists.obj : error LNK2019: unresolved external symbol _fseeko referenced in function _main [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_93c95.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\Debug\cmTC_93c95.exe : fatal error LNK1120: 1 unresolved externals [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_93c95.vcxproj]

    0 Warning(s)

    2 Error(s)


Build FAILED.

"C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_6e125.vcxproj" (default target) (1) ->

(ClCompile target) -> 

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_6e125.vcxproj]

    0 Warning(s)

    1 Error(s)


Build FAILED.

"C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_3a774.vcxproj" (default target) (1) ->

(ClCompile target) -> 

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CheckTypeSize\OFF64_T.c(19): error C2065: 'off64_t' : undeclared identifier [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_3a774.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CheckTypeSize\OFF64_T.c(20): error C2065: 'off64_t' : undeclared identifier [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_3a774.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CheckTypeSize\OFF64_T.c(21): error C2065: 'off64_t' : undeclared identifier [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_3a774.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CheckTypeSize\OFF64_T.c(22): error C2065: 'off64_t' : undeclared identifier [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_3a774.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CheckTypeSize\OFF64_T.c(23): error C2065: 'off64_t' : undeclared identifier [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_3a774.vcxproj]

    0 Warning(s)

    5 Error(s)



Build FAILED.

"C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_0f669.vcxproj" (default target) (1) ->

(Link target) -> 

  CheckFunctionExists.obj : error LNK2019: unresolved external symbol _jbg_newlen referenced in function _main [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_0f669.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\Debug\cmTC_0f669.exe : fatal error LNK1120: 1 unresolved externals [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_0f669.vcxproj]

    0 Warning(s)

    2 Error(s)



Build FAILED.

"C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_2f0ec.vcxproj" (default target) (1) ->

(Link target) -> 

  CheckFunctionExists.obj : error LNK2019: unresolved external symbol _mmap referenced in function _main [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_2f0ec.vcxproj]

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\Debug\cmTC_2f0ec.exe : fatal error LNK1120: 1 unresolved externals [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_2f0ec.vcxproj]

    0 Warning(s)

    2 Error(s)



Build FAILED.

"C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_4b3e8.vcxproj" (default target) (1) ->

(ClCompile target) -> 

  C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\OpenCV3.0.0\opencv\build\CMakeFiles\CMakeTmp\cmTC_4b3e8.vcxproj]

    0 Warning(s)

    1 Error(s)

我正在使用Visual Studio 2013并使用OpenCV3.0.0在c ++中编码。

1 个答案:

答案 0 :(得分:0)

请重新提取opencv并按照以下两个链接的步骤操作:

Install OpenCV 3.0 on Windows 8

Create an Visual Studio (2013) Project with openCV

如果这对您有用,请告诉我..