本文介绍了如何在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.
- 安装MinGW(我猜这步已经完成了),包括
mingw32-make
- 为
mingw32-make
创建一个makefile,名为MinGWMakefile
目标:clean
,build
和rebuild
。 - 为您的项目创建新配置
- 转到配置属性 - >常规 - >配置类型,然后选择makefile
- 转到配置属性 - > NMake,并使用以下命令行:
- Install MinGW (I guess this step is already done), including
mingw32-make
- Create a makefile for
mingw32-make
calledMinGWMakefile
, with 3 targets:clean
,build
, andrebuild
. This can be very tedious if you've never done that before. - Create a new configuration for your project
- Go to configuration properties->general->configuration type, and select "makefile"
- 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 ++编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!