如何解决依赖OpenCV的GPU程序编译问题?

发布于 2024-10-01 02:56:25 字数 3687 浏览 1 评论 0原文

如何解决这个编译问题呢?

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

探春 2024-10-08 02:56:25

SO 不是调试器,但此错误报告基本上告诉您它无法打开“cxcore200d.lib”。那是你的问题。您可能还需要查看 19 条警告。

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.

安静被遗忘 2024-10-08 02:56:25

配置 Visual Studio

打开 VC++ 目录配置:
工具>选项>项目与解决方案> VC++ 目录

选择“显示目录:包含文件”
添加“$openCVDir\include\opencv”
选择“显示目录:库文件”
添加“$openCVDir\lib”
选择“显示目录:源文件”
添加“$openCVDir\src\cv”
添加“$openCVDir\src\cvaux”
添加“$openCVDir\src\cxcore”
添加“$openCVDir\src\highgui”
配置您的项目

创建项目后,您需要添加 OpenCV 依赖项。

打开项目属性:项目> %projectName% 属性...
打开链接器输入属性:
配置属性>链接器>输入打开“...”窗口编辑“附加依赖项”并在每一行上输入:
“cv210.lib”
“cxcore210.lib”
“highgui210.lib”
以及您的项目所需的任何其他 lib 文件 您的项目现在应该构建。如果出现任何错误,请尝试重新启动 Visual Studio,然后进行干净的重建。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文