2010-11-09 80 views
0

如何解決這個編譯問題?如何解決依賴OpenCV的GPU程序的編譯問題?

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 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(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 ========== 

回答

1

配置的Visual Studio

打開VC++目錄配置: 工具>選項>項目和解決方案> VC++目錄

選擇 「顯示目錄:包括文件」 添加 「$ openCVDir \包括\ OpenCV的」 選擇 「顯示目錄:庫文件」 添加 「$ openCVDir \ LIB」 選擇 「顯示目錄:源文件」 添加 「$ openCVDir的\ src \ CV」 添加 「$ openCVDir的\ src \ cvaux」 添加「$ openCVDir的\ src \ cxcor e「 添加」$ openCVDir \ src \ highgui「 配置您的項目

創建項目後,您需要添加OpenCV依賴項。

打開項目屬性:項目>%PROJECTNAME%屬性... 打開鏈接器輸入屬性: 配置屬性>鏈接>輸入打開「...」窗口編輯‘附加依賴’,並在每行認沽: 「cv210.lib」 「cxcore210.lib」 「highgui210.lib」 和您的項目所需的任何其他lib文件您的項目現在應該建立。如果出現任何錯誤,請嘗試重新啓動Visual Studio,然後執行乾淨的重建。

5

SO不是一個調試器,但這個錯誤報告基本上是告訴你,它不能打開「cxcore200d.lib」。那是你的問題。還有19條警告你可能想看。