User forums > Help

How do I get GCC to work with C::B?

(1/3) > >>

Panzercrisis:
That question sounds more newbish than it should.  No matter how simple of a program I try to make with Code::Blocks, no matter how closely I follow tutorials and how much I use all of the default settings, I get this error:

"firstTry - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Skipping...

firstTry is the project name, by the way.  I have noticed that compilers need to be pulled in for this program to work, but I've used the download that includes the GCC compiler.  But even that won't work, not even for the simplest C or C++ program that can be made.  What do I do about this?

Also, is there a way I can use GCC in this environment to take care of C++ code?

Seronis:
make sure you only have ONE copy of mingw installed.   And that the paths listed in

"Settings" ->  "Compiler and Debugger" -> "Global Compiler Settings" -> "Toolchain Executables"

matches what you have installed.  I personally keep all the executable paths for mingw in my system PATH variable too.  Since i always install mingw to  c:/dev/mingw  in my system path i have

C:\Dev\MinGW\bin;C:\Dev\MinGW\mingw32\bin;C:\Dev\MinGW\libexec\gcc\mingw32\4.4.0;

prefixed to the front of my PATH variable.  Though that just allows me to run gcc from the command line in addition to via C::B.  Setting toolchain correctly is all CB needs as long as there are no conflicts.

stahta01:
Learn to Google and read!

And, how to ask smart questions.
http://catb.org/esr/faqs/smart-questions.html

My last real answer to this question less than two weeks old.
http://forums.codeblocks.org/index.php/topic,10935.0.html

Tim S.

http://www.google.com/search?q=site%3Aforums.codeblocks.org+%22uses+an+invalid+compiler.+Skipping%22


Panzercrisis:
There's a problem with that though.

I followed the advice given, and it worked the first time, so I closed C::B and left for a while.  When I came back, that same advice stopped working.  There was one other person I've noticed mentioning this in the forums and he got nothing but criticism for saying it.

But this is a real problem.  The compiler is there.  I used the auto-detect feature on the toolchain part of the IDE, and it worked one time, but now it won't work (even with the same project and code file and everything!).  What's the deal with that?

Panzercrisis:
I've been toying around with that while waiting on a reply, and I made a new project with a new name (whereas I had just been recycling the same name and path again and again).  The compiler worked again.  So to test with this project that which had gone wrong with the last, I closed C::B out, ran it again, and opened the new project.  The compiler worked again.

Strange. 

And I did look around on Google and forums before bringing this anomaly up, but again all I saw was one guy getting nothing but rebuke for mentioning roughly the same error, so this particular question is harder to locate than the original.

Navigation

[0] Message Index

[#] Next page

Go to full version