编译此C+;时如何解决链接器问题+;需要过剩的程序? 我试图编译这个利用GLUT32库的C++程序。

编译此C+;时如何解决链接器问题+;需要过剩的程序? 我试图编译这个利用GLUT32库的C++程序。,c++,opengl,linker,compiler-errors,glut,C++,Opengl,Linker,Compiler Errors,Glut,现在我得到了以下错误: 错误1错误LNK2001:未解决 外部符号 _gluPerspective@32Camera.obj soundCube 错误2错误LNK2001:未解决 外部符号 _gluLookAt@72Camera.obj soundCube错误3错误LNK2001:未解决 外部符号 __小鬼__glMaterialfv@12GLWindow.obj soundCube 错误4错误LNK2001:未解决 外部符号 __小鬼__glClear@4GLWindow.obj soundC

现在我得到了以下错误:

错误1错误LNK2001:未解决 外部符号 _gluPerspective@32Camera.obj soundCube 错误2错误LNK2001:未解决 外部符号 _gluLookAt@72Camera.obj soundCube错误3错误LNK2001:未解决 外部符号 __小鬼__glMaterialfv@12GLWindow.obj soundCube 错误4错误LNK2001:未解决 外部符号 __小鬼__glClear@4GLWindow.obj soundCube错误5错误LNK2001:未解决 外部符号 __小鬼__glClearColor@16GLWindow.obj soundCube 错误6错误LNK2001:未解决 外部符号 __小鬼__glMaterialf@12GLWindow.obj soundCube错误7错误LNK2001:未解决 外部符号 __小鬼__glEnd@0GLWindow.obj soundCube错误8错误LNK2001:未解决 外部符号 __小鬼__glRasterPos2f@8GLWindow.obj soundCube 错误9错误LNK2001:未解决 外部符号 __小鬼__timeGetTime@0GLWindow.obj soundCube错误10错误LNK2001:未解决 外部符号 __小鬼__glDisable@4GLWindow.obj soundCube 错误11错误LNK2001:未解决 外部符号 __小鬼__glBegin@4GLWindow.obj soundCube错误12错误LNK2001:未解决 外部符号 __小鬼__glColor4f@16GLWindow.obj soundCube 错误13错误LNK2001:未解决 外部符号 __小鬼__glPopMatrix@0GLWindow.obj soundCube错误14错误LNK2001:未解决 外部符号 __小鬼__glPushMatrix@0GLWindow.obj soundCube错误15错误LNK2001:未解决 外部符号 __小鬼__glRotatef@16GLWindow.obj soundCube 错误16错误LNK2001:未解决 外部符号\uuuu imp__glBlendFunc@8

错误56致命错误LNK1120:55 悬而未决 外部C:\Users\Simucal\Documents\Downloads\SoundCubeSrc soundCube

<>我不是C++的经验丰富的,但是我尝试正确设置GLUT,所以这个项目可以链接到它。 我下载了GLUT32库以供参考

然后,我将以下文件放入:

  • glut.h-C:\Program Files\Microsoft SDK\Windows\v6.0A\Include\gl
  • glut32.lib-C:\Program Files\Microsoft SDK\Windows\v6.0A\lib
  • glut.dll-C:\Windows\System32
我还选择了项目->属性->链接器->附加依赖项->添加了“glut32.lib”

如果有人想看看我在做什么项目,那就是


为了解决这些错误,我遗漏了什么步骤或做错了什么

在我看来,您混合了静态和动态链接选项。我正在下载你的项目进行调查,但是你在做什么类型的编译

我在项目中没有看到对glut.lib文件的引用

我添加了库引用和LIB/INCLUDE路径:

diff --git a/soundCube/soundCube.vcproj b/soundCube/soundCube.vcproj
index 62e04c1..b71eb20 100644
--- a/soundCube/soundCube.vcproj
+++ b/soundCube/soundCube.vcproj
@@ -41,6 +41,7 @@
            <Tool
                Name="VCCLCompilerTool"
                Optimization="0"
+               AdditionalIncludeDirectories="d:\temp\glut"
                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
                MinimalRebuild="true"
                BasicRuntimeChecks="3"
@@ -60,7 +61,9 @@
            />
            <Tool
                Name="VCLinkerTool"
+               AdditionalDependencies="glut32.lib"
                LinkIncremental="2"
+               AdditionalLibraryDirectories="d:\temp\glut\GL"
                GenerateDebugInformation="true"
                SubSystem="1"
                TargetMachine="1"
@@ -114,6 +117,7 @@
                Name="VCCLCompilerTool"
                Optimization="2"
                EnableIntrinsicFunctions="true"
+               AdditionalIncludeDirectories="d:\temp\glut"
                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
                RuntimeLibrary="0"
                EnableFunctionLevelLinking="true"
@@ -132,7 +136,9 @@
            />
            <Tool
                Name="VCLinkerTool"
+               AdditionalDependencies="glut32.lib"
                LinkIncremental="1"
+               AdditionalLibraryDirectories="d:\temp\glut\GL"
                GenerateDebugInformation="true"
                SubSystem="1"
                OptimizeReferences="2"
diff--git a/soundCube/soundCube.vcproj b/soundCube/soundCube.vcproj
索引62e04c1..b71eb20 100644
---a/soundCube/soundCube.vcproj
+++b/soundCube/soundCube.vcproj
@@ -41,6 +41,7 @@

在我看来,你混合了静态和动态链接选项。我正在下载你的项目进行调查,但是你在做什么类型的编译

我在项目中没有看到对glut.lib文件的引用

我添加了库引用和LIB/INCLUDE路径:

diff --git a/soundCube/soundCube.vcproj b/soundCube/soundCube.vcproj
index 62e04c1..b71eb20 100644
--- a/soundCube/soundCube.vcproj
+++ b/soundCube/soundCube.vcproj
@@ -41,6 +41,7 @@
            <Tool
                Name="VCCLCompilerTool"
                Optimization="0"
+               AdditionalIncludeDirectories="d:\temp\glut"
                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
                MinimalRebuild="true"
                BasicRuntimeChecks="3"
@@ -60,7 +61,9 @@
            />
            <Tool
                Name="VCLinkerTool"
+               AdditionalDependencies="glut32.lib"
                LinkIncremental="2"
+               AdditionalLibraryDirectories="d:\temp\glut\GL"
                GenerateDebugInformation="true"
                SubSystem="1"
                TargetMachine="1"
@@ -114,6 +117,7 @@
                Name="VCCLCompilerTool"
                Optimization="2"
                EnableIntrinsicFunctions="true"
+               AdditionalIncludeDirectories="d:\temp\glut"
                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
                RuntimeLibrary="0"
                EnableFunctionLevelLinking="true"
@@ -132,7 +136,9 @@
            />
            <Tool
                Name="VCLinkerTool"
+               AdditionalDependencies="glut32.lib"
                LinkIncremental="1"
+               AdditionalLibraryDirectories="d:\temp\glut\GL"
                GenerateDebugInformation="true"
                SubSystem="1"
                OptimizeReferences="2"
diff--git a/soundCube/soundCube.vcproj b/soundCube/soundCube.vcproj
索引62e04c1..b71eb20 100644
---a/soundCube/soundCube.vcproj
+++b/soundCube/soundCube.vcproj
@@ -41,6 +41,7 @@

未解析符号来自GL和GLU库。您还需要为它们添加链接库。

未解析的符号来自GL和GLU库。你还需要为他们添加链接库。

我正在做一个项目,该项目是由一名已不在大学的日本学生传下来的。这是他应得的一份。我不完全确定。如果你在看这个项目时看到任何有用的东西,我将不胜感激!我正在做一个项目,这个项目是由一个已经不在大学的日本学生传下来的。这是他应得的一份。我不完全确定。如果你在看这个项目时看到任何有用的东西,我将不胜感激!