2016-07-12 4 views
0

간단한 OpenGL 프로그램을 만드는 데 문제가 있습니다. 내가첫 번째 OpenGL 프로그램을 작성하는 방법

  • SFML가 필요합니다 나는 몇 가지 조사를 않았다 및 OpenGL 프로그램을 만들기 위해 발견 -
  • GLEW 창
  • 를 만들기위한 - 내가 잠시 동안 SFML을 사용하고있다

을 처리 확장을 위해, 그것을 잘 작동합니다. 공식 SFML 페이지를 다음과 추가 링커 옵션을 추가 : -l opengl32 내가 컴파일 관리 코드가 Here.

그래서 내가 OpenGL 응용 프로그램을 만들에 이동 표시하지만, OpenGL을 -와 - SFML 전형적인 내가 할 수 없었다 GLEW를 설정 한 후에도 정의되지 않은 참조로 인해 그물에있는 튜토리얼을 컴파일하십시오. 지금 나는 this piece of code을 가지고 있는데, 가장 낮은 평가를받은 대답은 here입니다. 해당 게시물의 지침을 따르지만 오류가 계속 발생합니다.

C : \ prog \ GLEW \ 1.13 \ lib \ libglew32.a (glew.obj) : glew.c || 내가

  • 윈도우 10
  • Codeblocks 16.1
  • 기본는 MinGW를 사용하고 4 '

    @ wglGetProcAddress`로 정의되지 않은 참조는 codeblocks

  • (SFML, GLEW)
가득

** 수정 : **

내 전체 빌드 로그 :

-------------- Build: Debug in opengl_minus1 (compiler: GNU GCC Compiler)--------------- 

mingw32-g++.exe -LC:\prog\SFML\2.3.2\lib -LC:\prog\GLEW\1.13\lib -o bin\Debug\opengl_minus1.exe obj\Debug\main.o -l opengl32 C:\prog\SFML\2.3.2\lib\libsfml-graphics.a C:\prog\SFML\2.3.2\lib\libsfml-window.a C:\prog\SFML\2.3.2\lib\libsfml-system.a C:\prog\GLEW\1.13\lib\libglew32.a 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x29c): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x2b8): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x2d4): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x2e8): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x2fc): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x310): more undefined references to `[email protected]' follow 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x1786c): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x178bf): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x1792f): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x17943): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x1795e): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x179da): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x17b60): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x17b7c): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x17b9a): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x17f7c): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x17f98): more undefined references to `[email protected]' follow 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x19def): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x19f40): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x19f85): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x19fa1): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x19fbd): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x19fd6): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x1a08f): undefined reference to `[email protected]' 
C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj):glew.c:(.text+0x1a0ab): more undefined references to `[email protected]' follow 
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: C:\prog\GLEW\1.13\lib\libglew32.a(glew.obj): bad reloc address 0x13a98 in section `.rdata' 
C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: final link failed: Invalid operation 
collect2.exe: error: ld returned 1 exit status 
Process terminated with status 1 (0 minute(s), 0 second(s)) 
26 error(s), 0 warning(s) (0 minute(s), 0 second(s)) 
+1

후 링크 -lopengl32 당신은 opengl32''에 링크합니까? – tkausl

+0

누군가 제안 ** - 난 opengl32 ** 나는 그것이 일을 믿습니다. –

+0

오류가있는 링키지 도움말을 얻으려면 적어도 오류가있는 링크 명령과 그 이후의 오류 인 빌드 출력에서 ​​ 을 게시해야합니다. 이 정보를 질문의 본문에 추가하십시오. –

답변

0

wglGetProcAddress에 정의되지 않은 참조가 멤버에서 발생 라이브러리의 glew.obj이 라이브러리의 연결 순서는 기능 wglGetProcAddresslibopengl32에 정의되어 있지만 연결되지 입니다 libglew32 때문에 틀린 길. 연계 순서, 사람이 (가) 정의, 를 제공하기 전에 링커가 라이브러리에서 오브젝트 모듈을 연결에만 때문에이 를 제공하는 경우 기호 정의가 발생해야 할 파일에서

적어도 하나 개의 심볼의 정의 이미 링크에서 참조되었지만 아직 정의되지 않았습니다.

그래서 libglew32.a