GLUT가 필요한이 C ++ 프로그램을 컴파일 할 때 링커 문제를 해결하려면 어떻게해야합니까?

StackOverflow https://stackoverflow.com/questions/2217825

문제

GLUT32 라이브러리를 사용하는이 C ++ 프로그램을 컴파일하려고합니다.

지금 당장 나는 다음과 같은 오류를 받고 있습니다.

오류 1 오류 LNK2001 : 미해결 외부 기호 _gluperspective@32 Camera.OBJ SoundCube 오류 2 오류 LNK2001 : 미해상 외부 기호 _glulookat@72 Camare.OBJ SoundCube Error 3 오류 LNK2001 : Unresolved 외부 기호 __griatialfv@12 glwindow.obj soundcube 오류 4001. 해결되지 않은 외부 기호 __imp_glclear@4 glwindow.obj 사운드 큐브 오류 5 오류 LNK2001 : 미해결 외부 기호 __pr _glclearcolor@16 glwindow.obj soundcube 오류 6 오류 lnk2001 : __ph __gh glwindow.obj uncube 7 uncuble eloperold el 0 GLWINDOW.OBJ SONDCUBE ERROR 8 오류 LNK2001 : 해결되지 않은 외부 기호 __imp__glrasterpos2f@8 glwindow.obj 사운드 큐브 오류 9 오류 LNK2001 : 미해결 외부 기호 __MP_THEGGETTIME@0 glwindow.OBJ 사운드 큐브 오류 10 오류 LNK2001 : Unresolved External __gruder __gruder __grude 오류 11 오류 LNK2001 : 해결되지 않은 외부 기호 __imp_glbegin@4 glwindow. OBJ SoundCube Error 12 Error LNK2001 : 미해결 외부 기호 __imp__glcolor4f@16 glwindow.obj 사운드 큐브 오류 13 오류 LNK2001 : UNSOLVED 외부 기호 __imp_glpopmatrix@0 glwindow.obj soundcube 오류 14 오류 LNK2001 : Unresolved ___gl ___gl ___gl ___gl ___gl ___ LNK2001 : 해결되지 않은 외부 기호 __imp_glrotatef@16 glwindow.obj soundcube 오류 16 오류 LNK2001 : 해결되지 않은 외부 기호 __imp_glblendfunc@8

...

오류 56 치명적인 오류 LNK1120 : 55 USSOLVED 외부 C : Users Simucal Documents Downloads SoundCubesrc SoundCube

나는 C ++에서 경험이 없었지만 GLUT를 올바르게 설정하려고 노력 했으므로이 프로젝트가 연결될 수 있습니다.

Glut32 라이브러리를 다운로드했습니다 네이트 로빈의 페이지.

그런 다음 다음 파일을 다음에 배치했습니다.

  • glut.h -c : program files microsoft sdks windows v6.0a include gl
  • glut32.lib -c : program files microsoft sdks windows v6.0a lib
  • glut.dll -c : windows system32

또한 프로젝트 -> 속성 -> 링커 -> 추가 종속성 -> 추가 "glut32.lib"를 선택했습니다.

누구든지 내가 일하는 프로젝트를보고 싶다면 여기.

이러한 오류를 해결하기 위해 어떤 단계를 놓치거나 잘못하고 있습니까?

도움이 되었습니까?

해결책

해결되지 않은 기호는 GL 및 GLU 라이브러리에서 나온 것입니다. 링크 라이브러리도 추가해야합니다.

다른 팁

정적 및 동적 링크 옵션을 혼합하는 것처럼 보입니다. 조사를 위해 프로젝트를 다운로드하고 있지만 어떤 유형의 편집을하고 있습니까?

프로젝트에서 glut .lib 파일에 대한 언급을 보지 못했습니다 ...

라이브러리 참조와 lib/포함 경로를 추가했습니다.

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"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top