开发者

use specific compiler with MINGW

开发者 https://www.devze.com 2023-02-22 02:19 出处:网络
I have an old project which i want to co开发者_开发百科mpile with the 4.1.2 version of GCC and G++. i have them downloaded, but i don\'t know how to give it to the MINGW to use them as default c/c++ c

I have an old project which i want to co开发者_开发百科mpile with the 4.1.2 version of GCC and G++. i have them downloaded, but i don't know how to give it to the MINGW to use them as default c/c++ compilers. Anyone know how to do it?


If you downloaded the whole package (gcc, binutils, runtime, win32api) from one release of MinGW (not required, but ensures compatibility), you can extract them some folder on your hard drive, say

C:\oldmingw

So that C:\oldingw\bin contains a gcc.exe.

Open a command prompt (type cmd.exe in the Vista/7 Orb search box or in the Windows "Run Command" dialog). Type

set PATH=C:\oldming\bin;%PATH%

Run

gcc -v

And ensure that the version reported is 4.1.2.

On linux, same thing, but the directory will be different, and your command to set PATH will be:

export PATH=/path/to/oldmingw:$PATH
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号