Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vc下编译ejoy2d #38

Open
D3Hunter opened this issue Mar 3, 2014 · 1 comment
Open

vc下编译ejoy2d #38

D3Hunter opened this issue Mar 3, 2014 · 1 comment

Comments

@D3Hunter
Copy link

D3Hunter commented Mar 3, 2014

不知道有没有人像我这样平时工作用vs,但不怎么用mingw,下面是在vs下编译ejoy2d的方法,有需要的可以看看:

前面的步骤就不说了,建工程(console程序),导入代码,下载必要的库文件,设置include路径之类的。下面的部分是解决编译连接的一些问题。

  1. ejoy2d用了gcc的语法扩展,在vs下要用c++方式编译,在属性高级-编译为,选c++。
  2. 但这样还编不了,需要把用到的扩展语法部分改成vs可识别的,比如动态数组,vs在c++编译也不支持。
  3. 以上两步就可以编译成功,但是还不能链接,需要把lua相关的头文件引入修改为extern “C",如下:
    extern "C"
    {

include <lua.h>

include <lauxlib.h>

include <lualib.h>

};

PS:ejoy2d.exe执行要在代码根目录,因为运行需要加载ejoy2d目录下的脚本

@actboy168
Copy link
Contributor

现在已经支持msvc的编译了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants