之前买的OpenGL编程指南第七版一直没看,最近开始看了,然后按照教程推荐的去指定网址下载NateRobin的OpenGL教程,但发现网址已经提示Error:404了, 然后谷歌搜索到可用的下载网址为:http://download.csdn.net/detail/sgnyyy/2792501;
下载了之后解压,在mac os上用xcode打开,然后编译运行,但是提示说:glmReadOBJ() failed: can't open data file "data/f-16.obj". Program ended with exit code: 1, 也就是不能打开data目录下的f-16.obj这个资源。猜想可能是需要引入这个目录但对xcode完全不会用!然后谷歌搜索找到一篇德语的该问题解决方案-_-!幸好有谷歌自动翻译!就是这个:https://www.apfeltalk.de/community/threads/opengl-glut-xcode.111027/
其中的9楼网友回答:
---------------------------------原文begin-------------------------------------------
Es ist ganz einfach:
1) Wähle Dein Executable (z.B. fog)
2) Wähle "Edit Active Executable fog" aus dem Projekt Menu
3) Im "General" Tab, wähle für "Set the working directory to:" "Project Directory"
Fertig, geht.
Dann kannst Du noch glm.h aus der Build Phase im Target löschen, da hat ein .h File nichts verloren.
Gruss
Alex
--------------------------------译文begin-------------------------------------------
这是非常简单的:
1)选择您的可执行文件(例如,雾)
2)从项目菜单中选择“编辑活动的可执行雾”
3)在“常规”选项卡,选择“设置工作目录”,“项目目录”
DONE ,去。
然后,你仍然可以从目标构建阶段删除glm.h,因为.h文件没有丢失。
格鲁斯
亚历克斯
原来只要选中该可执行项(比如工程里面的fog),然后点选fog -> 再点选Edit Scheme,接着选择option选项卡,接着勾选working Directory 选择该xcode工程目录即可,然后点击close关闭。
接着就可以command + R运行即可看到效果。