Ubuntu下OpenGL使用QT调试

  1. 安装Qt

  2. QT中open project,选择cmakelist.txt

  3. Run cmake

  4. build位置选择在OpenGL文件夹下已经编译好的build文件夹里,已经选错的话在project里更改


    Ubuntu下OpenGL使用QT调试_第1张图片
    Paste_Image.png
  5. 点左下角的小锤子编译

  6. 点左下角的电脑图标,选择要运行的程序运行,注意:要将tutorial xxx文件夹里面的其他文件放到build下才能正常运行,或者将编译好的文件放到tutorial xxx下。


    Ubuntu下OpenGL使用QT调试_第2张图片
    Paste_Image.png

参考
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/

In QtCreator, go to File->Tools->Options->Compile&Execute->CMake
Set the path to CMake. This is most probably /usr/bin/cmake
File->Open Project; Select tutorials/CMakeLists.txt
Select a build directory, preferably outside the tutorials folder
Optionally set -DCMAKE_BUILD_TYPE=Debug in the parameters box. Validate.
Click on the hammer on the bottom. The tutorials can now be launched from the tutorials/ folder.
To run the tutorials from QtCreator, click on Projects->Execution parameters->Working Directory, and select the directory where the shaders, textures & models live. Example for tutorial 2 : ~/opengl-tutorial/tutorial02_red_triangle/

你可能感兴趣的:(Ubuntu下OpenGL使用QT调试)