2016-07-12 3 views
0

単純なOpenGLプログラムの作成に問題があります。 私はいくつかの研究を行なったし、私は最初のOpenGLプログラムのビルド方法

  • SFML必要がありますOpenGLのプログラム作りが判明 - ウィンドウ
  • GLEW作成について -

を扱う拡張するために、私は、しばらくの間、それをSFMLを使用しているが正常に動作します。公式SFMLページに続いて、および追加のリンカオプションを追加:-l opengl32私は典型的なOpenGLの-と-SFMLコードをコンパイルするために管理Here.

を示すだから私は、OpenGLアプリケーションを作るために移動するが、私はできませんでしたGLEWを設定した後でも、定義されていない参照があるため、ネット上のチュートリアルをコンパイルしてください。今私はthis piece of codehereからの最も感謝の応答から取った。私はその記事の指示に従いましたが、まだエラーが発生しています:

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

@ wglGetProcAddress `への未定義参照私はMinGWのは、コードブロック

  • (SFML、GLEW)
  • を詰め

    • のWindows 10
    • コードブロック16.1
    • デフォルトを使用しています

      ** 編集: **

      マイフルビルドログ:wglGetProcAddress

      -------------- 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

    誰かが私に言った** - l opengl32 **私はそれが仕事をすると信じています。 –

    +0

    失敗したリンケージのヘルプを得るには、少なくとも のリンケージコマンドとそれ以降のエラーを投稿する必要があります。 はビルド出力からそのままです。あなたの質問の本文にこの情報を追加してください。 –

    答えて

    0

    未定義の参照が会員で発生glew.obj libglew32ライブラリの機能wglGetProcAddresslibopengl32に定義されていますが、ライブラリの リンク順序があるので、リンクされていません間違った方法ラウンド。

    シンボル定義が必要なファイルは、 より前に存在しなければなりません。 シンボルが少なくとも1つ定義されている場合、リンカーはオブジェクトモジュールをライブラリからリンクするためです。すでにリンケージで参照されていますが、まだ定義されていません。

    だからlibglew32.a

    関連する問題