Changing the default MinGW compiler

General questions regarding the usage of CodeLite
Spirro
CodeLite Curious
Posts: 4
Joined: Fri Aug 03, 2012 7:59 am
Genuine User: Yes
IDE Question: c++
Contact:

Changing the default MinGW compiler

Post by Spirro »

I have been using Code::Blocks for projects and have a few things I dislike about that IDE so I did more searching and found this one. I have gotten it set up successfully and managed to compile code from external libraries dynamicly, still trying to figure out static linking. One thing I would like to do to enable me to give CodeLite a fair shake for evaluation is change the default search path of the MinGW compiler suite used. Currently I have the 4.7 version installed, but CodeLite comes with 4.6 that I can tell. I've looked at the IDE and haven't seen an option to change the default search path manually besides maybe creating a new compiler entry and setting up a path to it. I also searched the forums a bit and found this post http://forums.codelite.org/viewtopic.ph ... etup#p3414 where someone is asking the same question and it goes unanswered. Is there a quick and easy way to reset the search path to the compiler used by CodeLite without creating a new instance?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Changing the default MinGW compiler

Post by eranif »

By default, coelite adds the the bundled MinGW's to its path.
To change this:

You can either add the path to your MinGW to the PATH environment variable, like this:
From codelite's main menu: "settings -> environment variables"

Add this line last:

Code: Select all

PATH=C:\path\to\mingw47\bin;$(PATH)
OR
open the file:
C:\Program Files (x86)\CodeLite\registery.ini and update the 'mingw' entry in it

OR
from codelite's main menu: "Settings -> Build Settings -> gnu g++ -> Tools"
In the 'PATH environment variable' add this line:

Code: Select all

C:\path\to\mingw47\bin;$(PATH)
This will only fix the PATH for the compiler (the first options fixes it "globally", i.e. for the entire IDE but still it will not affect your Windows)

Note that the syntax is case sensitive so make sure you copy the lines as I wrote them (ofc, replace the incorrect paths to your MinGW..)

Eran
Make sure you have read the HOW TO POST thread
Spirro
CodeLite Curious
Posts: 4
Joined: Fri Aug 03, 2012 7:59 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Changing the default MinGW compiler

Post by Spirro »

Thank you for the quick reply. I decided to go with option one as option three seemed to need to be done on a per project basis. I entered the path to my installed version of MinGW into the environment variables then made a simple helloworld program which compiled succesfully. Just to be sure I renamed the folder of the default install of MinGW then rebuilt the code, which again worked. Then I outright deleted the default MinGW install and rebuilt again and happily everything went just fine. Thank you for pointing this feature out. I never would have figured it out.

There are still a few points of interest within CodeLite I would like to test out to determine if I would indeed switch over to it for coding, so expect to hear from me again if forum search and experimentation fail me.
Post Reply