如何,或者有没有可那将VC6或者vc7的编译器替换成gcc? 如题,现在有个文件可以用Cygwin的gcc编译,有没有可能把VC的编译器替换成gcc?像Intel C++ Compiler那样不是学计算机的,求教各位了,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 当然可以,IDE底层还是调用命令行的,如果编译器文件名和参数一样的话,改一下搜索路径就可以了。但是不同编译器的命令行开关不一样不同编译器的输出不一样。VC使用文件路径(行号)这种方法来帮助定位文件。一个简单的方法是,自己写一个编译器中转程序,来转换编译器参数和输出。另一个方法是使用Custom Build自己设置一下命令行。 感谢jiangsheng回复,是不是可以提供一个相关例子,因为我对编译器开关之类几乎一无所知,现在在研究一个PETSc的偏微分方程包,不得不用到这方面的东西,谢谢 GCC的网站上说VC++的命令行接口是不被支持的。我对GCC的命令行开关也不了解,也不知道又没有相关例子。我不知道你要研究的到底是什么,有何必要一定要用GCC。如果代码遵循C++标准,那么在任何一个支持C++标准的编译器下都可以编译。VC 2003的编译器的标准支持已经比较不错了。 改gcc实在比较困难,抓点gcc的man给你看看你就知道了 Overall Options -c -S -E -o file -pipe -v -x language Language Options -ansi -fall-virtual -fcond-mismatch -fdollars-in-identifiers -fenum-int-equiv -fexternal-templates -fno-asm -fno-builtin -fhosted -fno-hosted -ffreestanding -fno-freestanding -fno-strict-prototype -fsigned-bitfields -fsigned-char -fthis-is-variable -funsigned-bitfields -funsigned-char -fwritable-strings -traditional -traditional-cpp -trigraphs Warning Options -fsyntax-only -pedantic -pedantic-errors -w -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscript -Wcomment -Wconversion -Wenum-clash -Werror -Wformat -Wid-clash-len -Wimplicit -Wimplicit-int -Wimplicit-function-declaration -Winline -Wlong-long -Wmain -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-import -Wparentheses -Wpointer-arith -Wredundant-decls这么多的选项需要和VC++的cl对应,你能一个一个调过来么?另外gcc仅仅是一个c编译器,并不是C++编译器,如果你要编译C++代码的话,还需要再用g++才行,这样就非常非常麻烦了…… 关于Process Monitor的设置用法问题!! 请教为什么不能从文件前面插入字符? 我这段代码老报错!CTime::Format MFC中怎样添加多语言资源? 自己实现了CMyListctrl从Cwnd派生,如何响应拖放消息 主机字节顺序转化为点式IP CString如何存储byte型数组? 献给1979对越自卫还击留念 InvokeHelper 服务器如何判断客户端连接已经关闭? 进程外组件 多线程套间 中的对象在实现时如果只考虑进程外客户调用是否需要进行同步? 我自定义的类 想通过DCOM传送到远程机器, 能实现吗?
不同编译器的输出不一样。VC使用文件路径(行号)这种方法来帮助定位文件。一个简单的方法是,自己写一个编译器中转程序,来转换编译器参数和输出。另一个方法是使用Custom Build自己设置一下命令行。
我不知道你要研究的到底是什么,有何必要一定要用GCC。如果代码遵循C++标准,那么在任何一个支持C++标准的编译器下都可以编译。VC 2003的编译器的标准支持已经比较不错了。
-c -S -E -o file -pipe -v -x language Language Options
-ansi -fall-virtual -fcond-mismatch -fdollars-in-identifiers
-fenum-int-equiv -fexternal-templates -fno-asm -fno-builtin
-fhosted -fno-hosted -ffreestanding -fno-freestanding
-fno-strict-prototype -fsigned-bitfields -fsigned-char
-fthis-is-variable -funsigned-bitfields -funsigned-char
-fwritable-strings -traditional -traditional-cpp -trigraphs Warning Options
-fsyntax-only -pedantic -pedantic-errors -w -W -Wall
-Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscript
-Wcomment -Wconversion -Wenum-clash -Werror -Wformat
-Wid-clash-len -Wimplicit -Wimplicit-int
-Wimplicit-function-declaration -Winline -Wlong-long -Wmain
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs
-Wno-import -Wparentheses -Wpointer-arith -Wredundant-decls这么多的选项需要和VC++的cl对应,你能一个一个调过来么?另外gcc仅仅是一个c编译器,并不是C++编译器,如果你要编译C++代码的话,还需要再用g++才行,这样就非常非常麻烦了……