Windows 7下具有C ++和OpenGL/Freeglut的NetBeans [英] NetBeans with C++ and OpenGL / Freeglut under Windows 7

查看:75
本文介绍了Windows 7下具有C ++和OpenGL/Freeglut的NetBeans的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近试图弄清楚如何在NetBeans 7中使用freeglut. 我花了很多时间,但我没有找到合适的教程来将所需的内容绑定到其中.

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:

第一个是: -freeglut 2.8 =>为了进行编译,我需要MinGW和msys. 我都安装了,但是我不能配置"或全部制作"和进行安装" freeglut. 我没有找到易于理解的操作方法.

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?

最后一个: -将文件放入相应的文件夹后,如何在C ++项目的NetBeans 7下最终使用freeglut?

Last one: - Once put the files into corresponding folder, how to use finally freeglut under NetBeans 7 on a C++ project?

我感觉缺乏相关信息.

我发现的所有答案总是像: 下载,构建,安装并完成.但是我已经停留在安装"和构建"上.

All I found are always answers like: download, build, install and done. But I'm already stuck on the "install" and "build".

解决方案: 关闭NetBeans.

The solution: Close NetBeans.

  • 从mingw.org安装和下载MinGW
  • 安装后,将路径添加到SystemEnvironemt(例如:C:\ MinGW). 转到开始"->计算机",右键单击,选择属性 进入高级系统设置,在下面的对话框中按环境变量". 在系统变量"选项卡中,找到条目路径(或PATH) 添加:C:\ MinGW; 获得freeglut预编译包: (http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/) 有一个很好的教程如何设置.
  • 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.

现在玩得开心(只需#include,您就完成了. 玩得开心.

Now have fun (just #include " and you're done. have fun.

注1: 如果查找make时遇到问题,则文件夹为: C:\ MinGW \ msys \ 1.0 \ bin \ make.exe (将MinGW安装在C:\ MinGW上).

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"应获取msys ... 最后但并非最不重要的一点是,不要忘记将msys \ bin也添加到路径中. :)

"mingw-get install msys" in command line should get msys... last but not least dont forget to add msys\bin to path, too. :)

这是完整的教程,但是使用德语. http: //techchan.blog.de/2012/03/18/einrichten-opengl-netbeans-7-1-1-teil-0-start-13209096/

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.

推荐答案

在找到freeglut之前,我很难在Windows 7上的Netbeans中使用glut,我将其归因于glut非常过时,我找到的教程也是如此.

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.

也许这将帮助其他人寻找在Netbeans中使用freeglut的说明.这些说明类似于已经提供的链接中的说明,但是有助于说明如何在Netbeans中而不是从命令行使用它.本教程期望您已经使Netbeans和您的编译器一起工作.如果您还没有这样做,我发现这里的指南非常有用: http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw

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

  1. http://www下载并提取freeglut .transmissionzero.co.uk/computing/using-glut-with-mingw/放入易于访问的文件夹. (我建议使用C:/FrGlut)

  1. 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)

将bin文件夹(C:\ FrGlut \ bin)添加到Windows PATH变量,或将freeglut.dll从bin文件夹复制到C:\ Windows \ System32

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

打开Netbeans并打开或创建您的项目

Open Netbeans and open or create your project

转到:文件->项目属性

go to: file->project properties

选择编译器,转到包含目录,然后将路径添加到freeglut包含文件夹(C:\ FrGlut \ include)

Select your compiler, go to include directories, and add the path to your freeglut include folder (C:\FrGlut\include)

在链接器下,选择添加库,然后导航到文件C:\ FrGlut \ lib \ libfreeglut.a

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

-dynamic -lfreeglut -lopengl32 -LC:\FrGlut\lib\libfreeglut.a

Netbeans现在应该可以与您的freeglut库一起使用了.

Netbeans should now be ready to use with your freeglut library.

要使用glut库,请在源文件中添加以下内容:

To use the glut libary add the following include to your source:

#include <GL/glut.h>

请记住,为了使程序运行,freeglut.dll将需要与可执行文件一起共享,因为大多数用户还没有该文件.

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.

这篇关于Windows 7下具有C ++和OpenGL/Freeglut的NetBeans的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆