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

Ubuntu 14.04编译异常 #93

Open
sunxfancy opened this issue Nov 28, 2015 · 6 comments
Open

Ubuntu 14.04编译异常 #93

sunxfancy opened this issue Nov 28, 2015 · 6 comments

Comments

@sunxfancy
Copy link

发现一个问题,链接时有几个函数找不到:
/tmp/ccGBYpaA.o:在函数‘os_tmpname’中:
/home/sxf/data/workspace/Game/ejoy2d/lua/loslib.c:140: 警告: the use of tmpnam' is dangerous, better usemkstemp'
/tmp/ccfHosBu.o:在函数‘render_buffer_update’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:175:对‘glBindVertexArrayOES’未定义的引用
/tmp/ccfHosBu.o:在函数‘render_shader_create’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:329:对‘glGenVertexArraysOES’未定义的引用
/tmp/ccfHosBu.o:在函数‘close_shader’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:346:对‘glDeleteVertexArraysOES’未定义的引用
/tmp/ccfHosBu.o:在函数‘apply_va’中:
/home/sxf/data/workspace/Game/ejoy2d/lib/render/render.c:549:对‘glBindVertexArrayOES’未定义的引用

好像跟OpenGL 1和2的不同实现有关, 我找到了许多类似错误的修正提示但依旧没有效果, 希望能获得帮助,谢谢!

@cloudwu
Copy link
Contributor

cloudwu commented Nov 29, 2015

首先你要确定你的系统有运行现代 3d 游戏的能力,比如可以运行 3d 桌面。

其次,你需要有 opengl 的开发库,并支持 opengl es 2.0 api .

@sunxfancy
Copy link
Author

libgl1-mesa-dev和libgles2-mesa-dev我都已经安装过了
运行3d也没问题,而且我还开发过opengl1的C程序,也能正常工作

@cloudwu
Copy link
Contributor

cloudwu commented Nov 29, 2015

看起来是你的 opengl 不支持 VAO,

#if !defined (VAO_DISABLE) && !defined (__ANDROID__)
// If your platform doesn't support VAO, comment it out.
// Or define VAO_DISABLE first
#define VAO_ENABLE
#if defined (GL_OES_vertex_array_object)
#define glBindVertexArray glBindVertexArrayOES
#define glGenVertexArrays glGenVertexArraysOES
#define glDeleteVertexArrays glDeleteVertexArraysOES
#endif
#endif

你可以编译的时候定义宏 VAO_DISABLE

@cloudwu
Copy link
Contributor

cloudwu commented Nov 29, 2015

btw, MacOSX 的最新版强制要求用 VAO 了, 这是为什么 ejoy2d 给了一个 VAO 的实现的缘故。

@sunxfancy
Copy link
Author

确实是这个问题, 已解决, 非常感谢云风大神

@zhangchunlin
Copy link

记录下我最终在ubuntu14.04上编译过要做的事情:
安装包:

sudo apt-get install libglew-dev libgles2-mesa-dev liblua5.2-dev libfreetype6-dev

然后将 posix/winfont.c 里的 ttc 文件路径改成对应系统的,比如:

static const char* TTFONT = "/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc";

编译命令:

make CFLAGS='-DVAO_DISABLE -Ilib -Ilib/render -Ilua -I/usr/include/freetype2' linux

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

3 participants