Eclipse IDE中的SDL配置 [英] SDL configuration in Eclipse IDE

查看:107
本文介绍了Eclipse IDE中的SDL配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Linux x86环境(ubuntu)中的Eclipse上运行OpenGL代码: http://nehe.gamedev.net/tutorial/vertex_buffer_objects/22002/ 我在命令行输入

I am trying to get a OpenGL code run on Eclipse in Linux x86 environment (ubuntu): http://nehe.gamedev.net/tutorial/vertex_buffer_objects/22002/ The code would run properly after I input in the command line with

g ++ main.cpp错误.cpp课45.cpp -o课45 -L/usr/X11R6/lib/-lGL -lGLU sdl-config --cflags --libs

这是来自make文件的指令. 现在,我正在尝试使代码在Eclipse上运行,我知道我必须设置链接程序库GL和GLU以及链接程序库目录/usr/X11R6/lib/.但是,关于sdl-config --cflags --libs,我不确定如何在Eclipse中进行配置.

Which is the instruction from the make file. Now I'm attempting to get the code run on Eclipse, I know I must set up linker libraries GL and GLU and linker library directory /usr/X11R6/lib/. However, with respect to sdl-config --cflags --libs, I am not sure how to configure it within Eclipse.

推荐答案

创建一个新的C ++项目(文件">新建">"C ++项目").您将需要选择一个工具链-Linux GCC.

Create a new C++ project (File > New > C++ Project). You will need to pick a toolchain - Linux GCC.

如果要使用C ++ 11,请执行以下操作:

If you want to use C++11 do the following:

  1. 右键单击包资源管理器"下的项目,然后选择属性".
  2. 选择(C/C ++构建>设置> GCC C ++编译器>其他)
  3. 在其他标志"下添加:-std = c ++ 0x
  4. 单击应用",然后单击确定"

配置Eclipse以使用SDL2

Configure Eclipse to use SDL2

  1. 右键单击包资源管理器"下的项目,然后选择属性".
  2. 选择(C/C ++常规>路径和符号>库)
  3. 单击添加"并添加"SDL2",然后单击确定"
  4. 单击添加"并添加"SDL2main",然后单击确定"

此过程已经过测试并确认可以正常工作,尽管我对此没有任何贡献.信息来源于此处

This process has been tested and confirmed working although I don't take any credit for it. Information sourced from HERE

这篇关于Eclipse IDE中的SDL配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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