在Visual Studio上与glui32.lib和libcd.lib的链接错误 [英] Linkage error with glui32.lib and libcd.lib on Visual Studio
问题描述
我正在尝试将我的(非常)旧项目从Visual Studio 6移植到Visual Studio 2010.
I am trying to port a (very) old project of mine from Visual Studio 6 to Visual Studio 2010.
该项目是OpenGL应用程序,因此,它使用以下库(以及其他库):
The project is an OpenGL application, and as such, it uses the following libraries (amongst others):
- glu32.lib
- glui32.lib
- glut32.lib
- opengl32.lib
glui32.lib
库链接了libcd.lib
库,Visual Studio 2010不支持该库.
The glui32.lib
library links the libcd.lib
library, which is not supported on Visual Studio 2010.
所以我需要找到glui32.lib
库的版本,该版本链接了libcmtd.lib
库.
So I need to find a version of the glui32.lib
library, which links the libcmtd.lib
library instead.
我的问题是:
-
glui32.lib
库是否有这样的版本? - 如果可以,我可以在哪里下载它?
- 如果没有,我可以在Visual Studio 2010上使用
libcd.lib
库吗? - 如果可以,我可以在哪里下载它?
- 如果没有,我还有其他方法可以解决此链接错误吗?
- Is there any such version of the
glui32.lib
library? - If yes - where can I download it?
- If no - can I use the
libcd.lib
library on Visual Studio 2010? - If yes - where can I download it?
- If no - is there any other way for me to solve this linkage error?
更新
我将下面的答案保留为可接受的答案,但这是将OpenGL项目从Visual Studio 6移植到Visual Studio 2010(在Visual Studio 2010中创建项目之后)的解决方法:
I'm leaving the answer below as the accepted one, but here is a workaround for porting an OpenGL project from Visual Studio 6 to Visual Studio 2010 (after creating the project in Visual Studio 2010):
- 右键单击该项目,然后选择属性.
- 打开配置属性-> C/C ++->预处理器.
- 在预处理程序定义条目中,添加 GLUT_BUILDING_LIB .
- 在运行时库条目中,选择多线程(/MT)或多线程调试(/MTd). li>
- 打开配置属性->链接器->输入.
- 在其他依赖项条目中,添加 glu32.lib; glui32.lib; glut32.lib; opengl32.lib .
- 在忽略特定的默认库条目中,添加 libcd.lib .
- Right click the project and choose Properties.
- Open Configuration Properties --> C/C++ --> Preprocessor.
- In the Preprocessor Definitions entry, add GLUT_BUILDING_LIB.
- In the Runtime Library entry, choose Multi-threaded (/MT) or Multi-threaded Debug (/MTd).
- Open Configuration Properties --> Linker -->Input.
- In the Additional Dependencies entry, add glu32.lib;glui32.lib;glut32.lib;opengl32.lib.
- In the Ignore Specific Default Libraries entry, add libcd.lib.
推荐答案
您可以重建 GLUI .他们运送的MSVS项目可以毫无问题地转换为VS2010.
You can rebuild GLUI. The MSVS project they ship converts without issue to VS2010.
不过,您必须将其指向您的GLUT版本.
You will have to point it at your GLUT build though.
这篇关于在Visual Studio上与glui32.lib和libcd.lib的链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!