2012-06-18 3 views
1

코드 블록을 사용하여 GLEW를 작동시키고 싶습니다.
site에 제시된 첫 번째 방법이 효과가 있습니다.
이것은 실행 파일에 glew를 정적으로 컴파일하는 방법입니다.
그러나 나는 그것을 제대로 처리하지 못했습니다.
저는 PC, Windows 7, CodeBlocks 10.05를 실행 중입니다.GLEW + CodeBlocks 설정

이것은 내가 지금까지 한 일이다 :

  • Unziped

    • 다운로드 한 GLEW 1.7.0을 C로 :
    • 만든 빈 프로젝트를 CodeBlocks에
    • 이전 glew.h을 wglew을. h와 glew.c를 내 프로젝트 소스 디렉토리에 넣습니다.
    • 세 파일 모두를 프로젝트에 추가했습니다.
    • glew.cf의 변경된 포함 경로 glew.h 및 wglew.h 또는에서

      #include <GL/glew.h> 
      #include <GL/wglew.h> 
      

      다음 코드

      #define GLEW_STATIC 
      #include "glew.h" 
      
      int main() { 
          glewInit(); 
          return 0; 
      } 
      

    있는 간단한 메인 파일을 생성

    #include "glew.h" 
    #include "wglew.h" 
    
  • 에 그리고이 컴파일와 많은 경고가 발생할 것입니다 및 오류.

    glew.c|10050|warning: '__wglewReleaseVideoCaptureDeviceNV' redeclared without dllimport attribute: previous dllimport ignored| 
    glew.c|10052|warning: '__wglewBindVideoImageNV' redeclared without dllimport attribute: previous dllimport ignored| 
    glew.c|10053|warning: '__wglewGetVideoDeviceNV' redeclared without dllimport attribute: previous dllimport ignored| 
    glew.c|10054|warning: '__wglewGetVideoInfoNV' redeclared without dllimport attribute: previous dllimport ignored| 
    glew.c|10055|warning: '__wglewReleaseVideoDeviceNV' redeclared without dllimport attribute: previous dllimport ignored| 
    
  • 내가 잘못 어디 갔지 : 같은

    glew.c|2933|undefined reference to `[email protected]'| 
    glew.c|2934|undefined reference to `[email protected]'| 
    glew.c|2935|undefined reference to `[email protected]'| 
    glew.c|2936|undefined reference to `[email protected]'| 
    
  • 경고 : 같은

    • 오류?
      필요한 경우 더 많은 정보를 공유하게되어 기쁩니다!

  • 답변

    4

    opengl32으로 프로그램을 연결하고 #include 앞에 glew.c에 GLEW_STATIC을 정의하여 이러한 경고를 제거 할 수 있습니다.

    glewInit을 사용하려면 유효한 OpenGL 컨텍스트가 있어야하기 때문에 프로그램이 작동하지 않을 수도 있습니다. glut/glfw/SDL/wglCreateContext/등으로 생성해야합니다.