Author Topic: Code::Blocks not recognizing compiler  (Read 29126 times)

jon14

  • Guest
Code::Blocks not recognizing compiler
« on: June 20, 2007, 10:41:44 pm »
I've just downloaded the newest Code::Blocks with the built in GCC compiler(from this site). The installation went smoothly and I can create projects and files just fine. But I can't run them.

After building/running a file, the error at the bottom reads:
mindw32-g++.exe: installation problem, cannot exec 'cc1plus': No such file or directory

I haven't downloaded anything else or switched around any options. I'm new to this compiler so I apologize if this is a common issue.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Code::Blocks not recognizing compiler
« Reply #1 on: June 20, 2007, 10:48:38 pm »
Are you running Windows Vista? If so, do a search in the forum for a couple of related threads.

On an unrelated topic, the version of C::B which includes the GCC compiler is not the newest version; the nightly builds are leaps and bounds ahead.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #2 on: June 21, 2007, 12:04:59 am »
Are you running Windows Vista? If so, do a search in the forum for a couple of related threads.

On an unrelated topic, the version of C::B which includes the GCC compiler is not the newest version; the nightly builds are leaps and bounds ahead.

Thanks for the reply. I've checked out the forums and found a thread that was similar to mine. Unfortunately It didn't help my situation.
I've downloaded the nightly pack from here: http://forums.codeblocks.org/index.php/topic,6226.0.html
Along with the wxWidget dll and mingw10m.dll files.
I then downloaded some more files I got from a thread on this forum(it helped the guy with the same situation). I'm referring to this: http://savefile.com/files/753051

After installing all files and opening a console project, I still get the same error when running my code.

Code
"hello - Release" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Skipping...
Nothing to be done.

Any help is greatly appreciated.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Code::Blocks not recognizing compiler
« Reply #3 on: June 21, 2007, 01:03:39 am »
You still need to install the MinGW/GCC compiler itself. See this page in the Code::Blocks Wiki. If you have done so and it still doesn't work, make sure that the main compiler path in the "Other settings" tab of C::B's global compiler settings is correct.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #4 on: June 21, 2007, 01:39:31 am »
Yes, I have the main compiler installed. When I launch CB it picks it up and sets it as default.
Here are the menu settings I have:






Offline stahta01

  • Lives here!
  • ****
  • Posts: 7779
    • My Best Post
Re: Code::Blocks not recognizing compiler
« Reply #5 on: June 21, 2007, 05:07:02 am »
Simple thing that needs checked. What compiler is the project using?

From memory, "Project" -> "Build Options" and verify it is using the correct compiler.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #6 on: June 21, 2007, 03:00:42 pm »
Simple thing that needs checked. What compiler is the project using?

From memory, "Project" -> "Build Options" and verify it is using the correct compiler.

Tim S


Yes, it seems to be using the right one. The default compiler is set to GNU GCC.
Here's the menu:


There also seem to be 2 other compilers that share the GNU name. GNU ARM and GNU AVR. I tried switching to both, but it still gives me the same error.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7779
    • My Best Post
Re: Code::Blocks not recognizing compiler
« Reply #7 on: June 21, 2007, 04:05:59 pm »
What OS are you using? XP or Vista?

Have you verified that C:\MinGW contains an bin sub-folder?

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #8 on: June 21, 2007, 04:28:06 pm »
What OS are you using? XP or Vista?

Have you verified that C:\MinGW contains an bin sub-folder?

Tim S

I'm running Vista. And yes, My MinGW file does have a bin folder.

Offline darthdespotism

  • Almost regular
  • **
  • Posts: 163
    • Coder's Nemesis
Re: Code::Blocks not recognizing compiler
« Reply #9 on: June 21, 2007, 05:13:19 pm »
I worked it out a few weeks ago.

First search for your cc1plus.exe and add this Directory to your %PATH% - Environment - variable.

The try to compile the Hello World example with -v and try to reconstruct the Directorys told as "not found" at the beginning of the output. Add these via -I directly to the MinGW-Settings in Codeblocks.

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #10 on: June 21, 2007, 05:46:34 pm »
I worked it out a few weeks ago.

First search for your cc1plus.exe and add this Directory to your %PATH% - Environment - variable.

The try to compile the Hello World example with -v and try to reconstruct the Directorys told as "not found" at the beginning of the output. Add these via -I directly to the MinGW-Settings in Codeblocks.

Thanks for the reply. I'm a little confused though. I found my cc1plus directory, but can't figure out where to put it.
I added the cc1p to the (Search Directories) / (Compiler) tab and also added it to the (Toolchain Exec) / (Compiler Installation Directory) and C++ compiler.
As you can see here:



I'm not sure if I did it right since it gives me the same error.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7779
    • My Best Post
Re: Code::Blocks not recognizing compiler
« Reply #11 on: June 21, 2007, 05:48:47 pm »
Change you compiler installation directory to where you installed minGW.
Based on above "C:\C++\MinGW" is your installation directory.

Add "C:\C++\MinGW\libexec\gcc\mingw32\4.2.0" to "Additional Paths"

Tim S

« Last Edit: June 21, 2007, 05:52:18 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #12 on: June 21, 2007, 06:04:26 pm »
Change you compiler installation directory to where you installed minGW.
Based on above "C:\C++\MinGW" is your installation directory.

Add "C:\C++\MinGW\libexec\gcc\mingw32\4.2.0" to "Additional Paths"

Tim S



Yep, got that in there too. Still not working.

I'm on 3 days now trying to figure this out, I really appreciate all the help and do apologize for being a little annoying.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7779
    • My Best Post
Re: Code::Blocks not recognizing compiler
« Reply #13 on: June 21, 2007, 06:06:22 pm »
Yep, got that in there too. Still not working.

I'm on 3 days now trying to figure this out, I really appreciate all the help and do apologize for being a little annoying.

But, has the error changed from "uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]"?

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

jon14

  • Guest
Re: Code::Blocks not recognizing compiler
« Reply #14 on: June 21, 2007, 06:11:05 pm »
Yep, got that in there too. Still not working.

I'm on 3 days now trying to figure this out, I really appreciate all the help and do apologize for being a little annoying.

But, has the error changed from "uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]"?

Tim S

No, it still gives me the same error.
Here's my C++ compiler directory: