如何在Visual studio 2008中设置GNU G ++编译器 [英] How do I set GNU G++ compiler in Visual studio 2008

查看:567
本文介绍了如何在Visual studio 2008中设置GNU G ++编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将我的Visual Studio 2008编译器设置为GNU GCC。我也可以让它具体到项目?我没有找到任何确切的答案。

How do I set my Visual studio 2008 compiler to GNU GCC. Can I also make it specific to projects? I didn't find any conclusive answer.

谢谢。

推荐答案

p>您不能直接使用编译器。

You can't use the compiler directly.

但是,您可以调用makefile而不是使用内置的构建系统。



You can, however, invoke a makefile instead of using the built-in build system.



  1. 安装MinGW(我猜这步已经完成了),包括 mingw32-make

  2. mingw32-make 创建一个makefile,名为 MinGWMakefile 目标: clean build rebuild

  3. 为您的项目创建新配置

  4. 转到配置属性 - >常规 - >配置类型,然后选择makefile

  5. 转到配置属性 - > NMake,并使用以下命令行:
  1. Install MinGW (I guess this step is already done), including mingw32-make
  2. Create a makefile for mingw32-make called MinGWMakefile , with 3 targets: clean, build, and rebuild. This can be very tedious if you've never done that before.
  3. Create a new configuration for your project
  4. Go to configuration properties->general->configuration type, and select "makefile"
  5. Go to configuration properties->NMake, and use these command lines:
Build Command Line: mingw32-make -f MinGWMakefile build
ReBuild Command Line: mingw32-make -f MinGWMakefile rebuild
Clean Command Line: mingw32-make -f MinGWMakefile clean






在编译器消息上启用转到行功能:





您需要转换gcc的输出,从:

Enable "go to line" functionality on compiler messages:


You need to transform the output of gcc, from this:

filename:line:message

至此:

filename(line):message



我使用自定义C ++程序,但任何正则表达式工具都会执行该操作。

I was using a custom C++ program to do that, but any regular expression tool will do the trick.

这篇关于如何在Visual studio 2008中设置GNU G ++编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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