在VS2010下编译Lua 5.2 alpha [英] Compiling Lua 5.2 alpha under VS2010

查看:103
本文介绍了在VS2010下编译Lua 5.2 alpha的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio下编译Lua 5.2 alpha,但遇到错误,而且不知道如何解决.

I'd like to compile Lua 5.2 alpha under visual studio but I'm getting errors and I have no clue how to fix them.

error LNK1169: one or more multiply defined symbols found
error LNK2005: _main already defined in lua.obj

如果有人可以指导我完成针对Lua 5.2 alpha的VS2010解决方案的创建,或者将我引向相关资源,我将不胜感激.

I'd be grateful if anyone could guide me through the creation of a VS2010 solution for Lua 5.2 alpha, or point me to related resources.

提前谢谢.

推荐答案

您很可能在一个VS项目中同时编译luac.clua.c.要在VS中构建Lua,您需要三个项目:

You are most probably compiling both luac.c and lua.c in one VS project. To build Lua yourself in VS you need three projects:

库-这应该是DLL或静态库项目.应该在src/ luac.clua.c下包括每个.c文件.仅在嵌入时才需要.

library - this should be either DLL or static library project. Should include every .c file under src/ except luac.c and lua.c. You only need this if you are embedding.

编译器-控制台可执行文件,包含luac.c

compiler - console executable, containing luac.c

解释器-控制台可执行文件,包含lua.c

interpreter - console executable, containing lua.c

这篇关于在VS2010下编译Lua 5.2 alpha的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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