Setup up GLUT projects in Codeblocks (Ubuntu 12.04)

天大地大妈咪最大 提交于 2019-11-30 17:51:40

问题


I installed the freeglut3 and freeglut3-dev by apt-get. I want to create a OPENGL GLUT Project in Codeblocks. I was asked the GLUT's location and I entered "/usr" as I found in a tutorial. But I got the error message:

"The path you entered seems valid, but this wizard can't locate the following GLUT's library file: glut in it."

Did I set the right location? What is the right way to setup up such a glut project?


回答1:


I have also faced the same problem. But I solve the problem Without creating the project and run the GLUT program. For that go to compiler and debugger setting and in linker tab and link library libGL.so , libGLU.so, libglut.so form directory usr/lib by pressing add button. Now you can include glut.h header and run the project.




回答2:


I am assuming you already have glut installed.

Open codeblocks and select Opengl project. While inside go to settings -> compiler -> linker settings -> link libraries Add glut GL and GLU one by one separately.

Your code should run.




回答3:


GLEW, GL, GLU, glut

Add these one by one to your project's link libraries after installing them.




回答4:


You should try /usr/local location if you were executing ./configure and installation with default parameters




回答5:


I was facing the same problem. Doing two things solved my problem.

  1. I added GL, GLU, glut one by one to my project's link libraries. (When I tried to add GLEW, it showed error. I didn't add GLEW and it didn't cause any problem.)

  2. I used the line #include <GL/glut.h> to include the header file glut.h. #include <GLUT/glut.h> or #include <glut.h> was showing me fatal error that header file not found.



来源:https://stackoverflow.com/questions/14234205/setup-up-glut-projects-in-codeblocks-ubuntu-12-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!