开发者

How to resolve compilation of GPU program that relies on OpenCV?

How to solve this compilation problem?

1>tmpxft_00001548_00000000-14_buildSURFDescriptorsGPU.ii
1>Compiling...
1>getMatchesGPU.cpp
1>utils.cpp
1>surf.cpp
1>main.cpp
1>C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc\cutil_inline_runtime.h(61) : warning C4005: 'MIN' : macro redefinition
1>        C:\OpenCV2.0\include\opencv\cxtypes.h(205) : see previous definition of 'MIN'
1>C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc\cutil_inline_runtime.h(62) : warning C4005: 'MAX' : macro redefinition
1>        C:\OpenCV2.0\include\opencv\cxtypes.h(209) : see previous definition of 'MAX'
1>.\main.cpp(290) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(290) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(290) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(290) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(291) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(291) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(291) : warning C4开发者_Go百科244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(291) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(325) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(325) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(325) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>.\main.cpp(325) : warning C4244: 'argument' : conversion from 'float' to 'int', possible loss of data
1>ipoint.cpp
1>integral.cpp
1>C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc\cutil_inline_runtime.h(61) : warning C4005: 'MIN' : macro redefinition
1>        C:\OpenCV2.0\include\opencv\cxtypes.h(205) : see previous definition of 'MIN'
1>C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc\cutil_inline_runtime.h(62) : warning C4005: 'MAX' : macro redefinition
1>        C:\OpenCV2.0\include\opencv\cxtypes.h(209) : see previous definition of 'MAX'
1>helper_funcs.cpp
1>fasthessian.cpp
1>C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc\cutil_inline_runtime.h(61) : warning C4005: 'MIN' : macro redefinition
1>        C:\OpenCV2.0\include\opencv\cxtypes.h(205) : see previous definition of 'MIN'
1>C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc\cutil_inline_runtime.h(62) : warning C4005: 'MAX' : macro redefinition
1>        C:\OpenCV2.0\include\opencv\cxtypes.h(209) : see previous definition of 'MAX'
1>.\fasthessian.cpp(176) : warning C4018: '<' : signed/unsigned mismatch
1>Generating Code...
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'cxcore200d.lib'
1>Build log was saved at "file://c:\SURFGPU-1.0.1\surf.dir\Debug\BuildLog.htm"
1>surf - 1 error(s), 19 warning(s)
2>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration 
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 1 skipped ==========


SO is not a debugger, but this error report is basically telling you it can't open 'cxcore200d.lib'. That is your problem. There are also 19 warnings you might want to look at.


Configure Visual Studio

Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories

Choose "Show directories for: Include files" Add "$openCVDir\include\opencv" Choose "Show directories for: Library files" Add "$openCVDir\lib" Choose "Show directories for: Source files" Add "$openCVDir\src\cv" Add "$openCVDir\src\cvaux" Add "$openCVDir\src\cxcore" Add "$openCVDir\src\highgui" Configure your Project

After you've created a project you'll need to add the OpenCV dependencies.

Open Project Properties: Project > %projectName% Properties... Open Linker Input properties: Configuration Properties > Linker > Input Open the "..." window to edit "Additional Dependencies" and on each line put: "cv210.lib" "cxcore210.lib" "highgui210.lib" And any other lib file necessary for your project Your project should now build. If you get any errors try restarting Visual Studio and then doing a clean Rebuild.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜