问题
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.
I added
GL
,GLU
,glut
one by one to my project's link libraries. (When I tried to addGLEW
, it showed error. I didn't addGLEW
and it didn't cause any problem.)I used the line
#include <GL/glut.h>
to include the header fileglut.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