Windows 编译 glut3.7

Windows 编译 glut3.7  

转自:http://tb01070.blog.163.com/blog/static/3708174820134124479753/

Windows 编译 glut3.7
1.下载glut37.zip和glut37data.zip,接到同一目录(glut-3.7)下;
 
2.配置目标路径:
(1)打开glut-3.7\glutwin32.mak,
 
(2)配置生成路径,参考如下:
# MSVC install directories
LIBINSTALL     = "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\lib"
INCLUDEINSTALL = "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\include\\GL"
 
# Win95 dll directory
#DLLINSTALL     = "C:\\Windows\\system32"
 
# WinNT dll directory
DLLINSTALL     = "C:\\Windows\\system32"
 
2.编译,打开Visual Studio 命令提示(2010)工具,进入glut-3.7目录,运行glutmake.bat;
 
3.Error,编译时出现打不开"glut32.lib"问题:
找到glut-3.7\lib\glut\Makefile.win,记事本打开,
$(link) $(LFLAGS) -out:$(GLUTDLL) -def:glut.def  $(OBJS) $(LIBS)
修改为:
$(link) $(LFLAGS) -out:$(GLUTDLL) -def:glut.def  $(OBJS) $(LIBS) -NODEFAULTLIB:$(GLUTLIB)
,然后重编;
 
4.Error, particle.c编译不过, timeb.h出错;
修改:
 
 
float timedelta(void)
{
    static long begin = 0;
    static long finish, difference;
/*
#if defined(_WIN32)
 
#include <stdio.h>
#include<time.h>
#include<sys/types.h> 
#include <sys/timeb.h>
   static struct _timeb tb;
 
  _ftime(&tb);
  finish = tb.time*1000+tb.millitm;
 
#else
#include <limits.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/times.h>
 
    static struct tms tb;
 
    finish = times(&tb);
#endif
*/
    difference =100;// finish - begin;
    begin = finish;
 
    return (float)difference/(float)1000;  /* CLK_TCK=1000 */
}
 
此后应该没问题了;
 
 
成功!
posted @ 2015-11-11 09:32  flylong0204  阅读(430)  评论(0)    收藏  举报