But for those of us what lived and died in them furious days
it was like everything we knew was mightily swept away
And no matter what they did to build the city up again
for the rest of time
it would be like no one even knew we was ever here.
----From a film
For long time exploring,I decide to start learning OpenGL.
During the time I will take notes the problems and the answers.
Today after downloading the Dev C++(Or CodeBlocks) and OpenGL,we need to set up the
environment for the programming.The OpenGL package I download is glutming.First we copy
the glut.h to ~/include/GL,copy glut32.dll to $WindowsDir$/system32,copy the glut32.lib to ~/lib.
Then I write a simple progrm to test the setting.The program can be compiled correctly but it
reports linkage error.By searching,I find a answer like this:
"I search this problem in google, and find this website:
http://www.iscs.nus.edu.sg/~liusheny/DevCppOpenGL.html
It is nearly the complete answer to me except the following linkage error:
[Linker error] undefined reference to '__glutInitWithExit@12'
[Linker error] undefined reference to '__glutCreateWindowWithExit@8'
[Linker error] undefined reference to '__glutCreateMenuWithExit@8'
Again I ask for help in the internet, and find the following answer:
try putting this in your source code, before the includes
#define GLUT_DISABLE_ATEXIT_HACK
To this moment, the linker error disappear, and we can run the program successfully.
Congratulations!"------http://fsli.blog.hexun.com/18279240_d.html
but I don't use it.I do three steps:
1) Not only we should copy the glut32.lib to ~/lib,we need the file "libglut32.a" go to there too.
2) Because I use win7 OS,it concerns the authority,we need start the Dev c++ using the admin right.
3) Before running the program,we need to add link "libopengl32.a libglu32.a libglut32.a" by the order to link libraries
the last I think it is better to using the four files --glut.h,glut32.dll,glut32.lib,libglut32.a in one version.
This seting is used in Windows7/Vista OS.
原文链接: https://www.cnblogs.com/liveshow/archive/2011/06/19/2084883.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/27416
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!