I recently tried to figure out how to use freeglut with NetBeans 7. I Google'd a lot and I didn't find a suitable tutorial on how to bind the stuff I need into it.
Currently I have more problem then this:
First one is: - freeglut 2.8 => in order to compile it I need MinGW and msys. I have both installed but I can't "configure" or "make all" and "make install" freeglut. I didn't find an easy-to-read how-to for that task.
Next one: - once built, where to put what files into a specific folder?
Last one: - Once put the files into corresponding folder, how to use finally freeglut under NetBeans 7 on a C++ project?
I feel like a lack of information on that.
All I found are always answers like: download, build, install and done. But I'm already stuck on the "install" and "build".
The solution: Close NetBeans.
- Install and download MinGW from mingw.org
- After installing, add the Path to your SystemEnvironemt (example: C:\MinGW). go to Start->Computer, right mousebutton, select properties go to advanced system setting, in the following dialog press "Environment Variables". in the tab "system variables", find the entry Path (or PATH) add: C:\MinGW; get freeglut pre-compiled package: (http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/) there is a good tutorial how to set up.
Now have fun (just #include " and you're done. have fun.
Note #1: if you have problems finding make, the folder is: C:\MinGW\msys\1.0\bin\make.exe (when installed MinGW on C:\MinGW).
"mingw-get install msys" in command line should get msys... last but not least dont forget to add msys\bin to path, too. :)
here's a full tutorial, but in german language. http://techchan.blog.de/2012/03/18/einrichten-opengl-netbeans-7-1-1-teil-0-start-13209096/
If you need it in english, let me know if you could translate it ;) otherwise i'll think about to translate it myself.
I had a difficult time getting glut working in Netbeans on Windows 7 until I found freeglut, I attributed this to the fact that glut is just very out of date and so are the tutorials I found.
Maybe this will help others looking for instructions on using freeglut in Netbeans. These instructions are like the ones in the link already provided, but help explain how to use it in Netbeans rather than from the command line. This tutorial expects that you've already gotten Netbeans and your compiler working together. IF you have not done so, I found the guide here very helpful: http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw
download and extract freeglut from http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ into an easy to reach folder. (I recommend C:/FrGlut)
either add the bin folder (C:\FrGlut\bin) to your Windows PATH variable, or copy the freeglut.dll from your bin folder into C:\Windows\System32
Open Netbeans and open or create your project
go to: file->project properties
Select your compiler, go to include directories, and add the path to your freeglut include folder (C:\FrGlut\include)
under linker, select add libary, and navigate to the file C:\FrGlut\lib\libfreeglut.a
select options and add the following individually:
-dynamic -lfreeglut -lopengl32 -LC:\FrGlut\lib\libfreeglut.a
Netbeans should now be ready to use with your freeglut library.
To use the glut libary add the following include to your source:
#include <GL/glut.h>
Remember that freeglut.dll will need to be shared along with your executable in order for the program to run, as most users will not already have it.
来源:https://stackoverflow.com/questions/9736760/netbeans-with-c-and-opengl-freeglut-under-windows-7