遵循以下说明的Eclipse CPP和GNU [英] Eclipse CPP and GNU following these instructions

查看:141
本文介绍了遵循以下说明的Eclipse CPP和GNU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建给定的预编译头以创建静态库.我不使用eclipse ide(我使用VC ++ 10),我需要帮助来理解这些说明:

I am trying to build a given a precompiled header to create a static library. I do not use the eclipse ide (I use VC++10) and I need help understanding these instructions:

如何构建GLUS:

  1. 为您的操作系统安装C/C ++开发人员的Eclipse IDE和GNU编译器集合.
  2. 解压缩此ZIP文件并将工作区-cpp文件夹设置为您的Eclipse工作区.
  3. 将每个文件夹作为一个单独的现有项目导入.
  4. 在Eclipse中将构建配置设置为您的操作系统.
  5. 构建GLUS.

我拥有GLUS的所有文件,但是我还没有将GLEW和GFLW与eclipse链接(是否在vc ++ 10中使用过,但不知道如何在eclipse中使用).所以我也需要帮助.

I have all the files for GLUS, but I have not yet linked GLEW and GFLW with eclipse (did it for vc++10 but dont know how in eclipse). So Id need help on that too.

替代方法:为什么不只在VC ++ 10上编译它? 好吧,我尝试并不断收到错误C1853并不能解决它.因此,我正在尝试通过说明解决问题. >.>

Alternative: why dont I just compile it on VC++10? Well, I tried and keep getting error C1853 and cant solve it. So im trying to solve the problem by the instructions. >.>

否则,如果有帮助,所有来源都位于.c中.有什么想法

otherwise, if it helps, all the sources are in .c. Any thoughts

推荐答案

似乎GLUS的源代码档案支持CMake,为什么不使用它呢?在此处下载可用的最新GLUS源,将源解压缩到任何目录,然后打开终端/命令提示符. .导航到将源代码解压缩到的目录,然后键入cmake .(假设cmake已安装在系统路径中)

It seems that the source code archive for GLUS supports CMake so why not just use that? Download the most recent GLUS source available here, unzip the source to any directory, and open a terminal / command prompt. Navigate to the directory you extracted the source code to and type cmake . (assuming cmake is installed in your system path)

在Windows中:

CMake将生成一个Visual Studio解决方案文件,您可以使用VS打开该文件并使用F5进行构建.如果构建成功,这将在GLUS/Debug中生成一个glus.lib文件.将此库文件添加到您的lib路径中,然后将/src中的src文件添加到您的包含路径中.

CMake will generate a visual studio solution file which you can open with VS and build with F5. If the build is successful, this will generate a glus.lib file in GLUS/Debug. Add this library file to your lib path, and add the src files in /src to your include path.

现在,如果仍然出现预编译的头错误(错误C1853),请在解决方案资源管理器中选择项目节点,右键单击,选择属性->配置属性-> C/C ++->高级->编译为".选择编译为C代码(/TC)".此外,您可能需要导航到属性->配置属性-> C/C ++->预编译头".您可以在此处看到预编译标头的选项设置,您可能需要使用这些设置;

Now, if your still getting precompiled header errors (error C1853), select the project node in Solution Explorer, right click, select "Properties->Configuration Properties->C/C++->Advanced->Compile As". Select "Compile as C Code (/TC)". Additionally you may want to navigate to "Properties->Configuration Properties->C/C++->Precompiled Headers". You can see the option settings here for precompiled headers, which you may want to play with;

在Unix/Linux/MAC中:

运行cmake后,键入make all进行构建,然后键入sudo make install将生成的文件推入系统路径.

After running cmake type make all to build and sudo make install to push the generated files into your system path.

这篇关于遵循以下说明的Eclipse CPP和GNU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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