VS2010编译glut-3.7

下好了glut(http://www.opengl.org/resources/libraries/glut/glut37.zip)后肯定想着编译它, 于是乎问题出现了, 编译通不过...

首先你要修改glutwin32.mak文件, 配置其中的输出目录

LIBINSTALL

INCLUDEINSTALL

DLLINSTALL

配置完成

然后, 你要保证你的编译环境能访问到win32.mak文件(这个文件在SDK中), 可以尝试使用2010的编译环境.

然后请打开\lib\glut\Makefile.win文件, 修改其中内容

在文件

$(link) $(LFLAGS) -out:$(GLUTDLL) -def:glut.def $(OBJS) $(LIBS)

修改为

$(link) $(LFLAGS) -out:$(GLUTDLL) -def:glut.def $(OBJS) $(LIBS) -NODEFAULTLIB:$(GLUTLIB)

因为一开始dll并不依赖glut32.lib, 但是生成时glut32.lib依赖了自己, 所以容易产生glut32.lib库找不到的错误

还没结束, 因为在particle.c(\progs\demos\particle\particle.c)下存在这一段代码错误, 所以还需要修改代码

/* timedelta: returns the number of seconds that have elapsed since

   the previous call to the function. */

float

timedelta(void)

{

    static long begin = 0;

    static long finish, difference;

 

#if defined(_WIN32)

#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 = finish - begin;

    begin = finish;

 

    return (float)difference/(float)1000;  /* CLK_TCK=1000 */

}

#if defined(_WIN32)

 

#include <sys/timeb.h>

 

#else

 

#include <limits.h>

#include <unistd.h>

#include <sys/types.h>

#include <sys/times.h>

 

#endif

 

/* timedelta: returns the number of seconds that have elapsed since

   the previous call to the function. */

float

timedelta(void)

{

    static long begin = 0;

    static long finish, difference;

 

#if defined(_WIN32)

    static struct timeb tb;

 

    ftime(&tb);

    finish = tb.time*1000+tb.millitm;

#else

    static struct tms tb;

 

    finish = times(&tb);

#endif

 

    difference = finish - begin;

    begin = finish;

 

    return (float)difference/(float)1000;  /* CLK_TCK=1000 */

}

然后在glut3.7目录下, 通过编译环境执行glutmake.bat

http://blog.csdn.net/u011558856/article/details/12256605

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值