2012-01-25 22 views
0

私のQtプログラムをOpenGL ES2関数に対してコンパイルしてリンクする方法を理解しようとしています。QtでコンパイルするOpenGL ES2を取得する方法

QGLWidgetを使用して、古いOpenGL 1.0パイプラインを使用してQtアプリケーションに単純な三角形を描画する簡単なプログラムを作成しました。私はVBOsやシェーダーなどの高度な2.0の機能を使用したいので、私はVBOのためのいくつかのバッファを割り当てるしようとするだけで十分で開始しました:

int ids[2]; 
glGenBuffers(2, ids); 

残念ながら、私のプロジェクトは、(glGenBuffersを見つけることができない)、私はエラーを取得しますメッセージ

GlWidget.cpp:103: error: 'glGenBuffers' was not declared in this scope 

qgl.hのスタートは「(QT_OPENGL_ES_2)に定義の#elif」の行を持っていたので)私は、プリプロセッサのためにそれを設定しようとしたが、それはまだ(glGenBuffersを見つけることができませんでした。

私は次に何を試すべきか分かりません。 QtプログラムでOpenGL ES2を使う方法を教えてください。

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/2010.02.1/qt/bin/qmake.exe SUBPROJECTS= .build-conf 
make[1]: Entering directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' 
/C/Qt/2010.02.1/qt/bin/qmake.exe VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro 
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk 
"/usr/bin/make" -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/CharacterEditor.exe 
make[2]: Entering directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' 
g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/2010.02.1/qt/include/QtCore' -I'c:/Qt/2010.02.1/qt/include/QtGui' -I'c:/Qt/2010.02.1/qt/include/QtOpenGL' -I'c:/Qt/2010.02.1/qt/include' -I'c:/Qt/2010.02.1/qt/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.02.1/qt/mkspecs/default' -o build/Debug/MinGW-Windows/main.o main.cpp 
g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/2010.02.1/qt/include/QtCore' -I'c:/Qt/2010.02.1/qt/include/QtGui' -I'c:/Qt/2010.02.1/qt/include/QtOpenGL' -I'c:/Qt/2010.02.1/qt/include' -I'c:/Qt/2010.02.1/qt/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.02.1/qt/mkspecs/default' -o build/Debug/MinGW-Windows/MainForm.o MainForm.cpp 
MainForm.cpp: In member function 'void MainForm::openFile()': 
MainForm.cpp:78: warning: unused variable 'surfSet' 
g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'c:/Qt/2010.02.1/qt/include/QtCore' -I'c:/Qt/2010.02.1/qt/include/QtGui' -I'c:/Qt/2010.02.1/qt/include/QtOpenGL' -I'c:/Qt/2010.02.1/qt/include' -I'c:/Qt/2010.02.1/qt/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.02.1/qt/mkspecs/default' -o build/Debug/MinGW-Windows/GlWidget.o GlWidget.cpp 
GlWidget.cpp: In member function 'void GlWidget::buildMesh()': 
GlWidget.cpp:103: error: 'glGenBuffers' was not declared in this scope 
make[2]: Leaving directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' 
make[2]: *** [build/Debug/MinGW-Windows/GlWidget.o] Error 1 
make[1]: *** [.build-conf] Error 2 
make: *** [.build-impl] Error 2 
make[1]: Leaving directory `/c/dev/kitfox.com/biz/monsterRacing/proj/CharacterEditor' 
+0

使用しているOpenGL ES 2.0の実装はどれですか? – genpfault

+0

あなたのプラットフォームは何ですか? OpenGL ESは組み込みシステム向けです。 –

+0

わかりません。私がそれをインストールしたときにQtに付属したものは何でも。私はMinGWでQt 4.6.2を使用しています。私はこのページの指示に従っています:http://netbeans.org/kb/docs/cnd/qt-applications.html – kitfox

答えて

0

あなたがGLEWが必要になる場合があります:私は、コンパイル時に

は、ここで私が得る出力です。見るべきリンクがいくつかあります。

GLEW

Initializing GLEW

Here's where I got those links

申し訳ありませんが、それはあなたが探しているものはない場合。

関連する問題