Code::Blocks
October 25, 2014, 05:58:49 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: When registered with our forums, feel free to send a "here I am" post in http://forums.codeblocks.org/index.php/topic,14168.0.html to differ human beings from SPAM bots.
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1] 2  All   Go Down
  Send this topic  |  Print  
Author Topic: "filename - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]....."  (Read 7719 times)
flubberknuckle
Newcomer
*
Offline Offline

Posts: 2


« on: September 11, 2010, 07:48:23 am »

I'm having a problem with compiling any code with codeblocks. I think I may have caused it when I deleted a bunch of my programs, but every step I take to fix it has failed. Here's what happened.

After uninstalling many of my computer's programs (not including codeblocks), I suddenly found that I could no longer compile projects which I could compile just hours before. When I tried to build and run those projects, I would receive this message-

"attacktest - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.

-in the build log, after which the code would not initiate. When I tried to compile other older projects or even brand new projects just created I would still receive the same message.

 After a while of this, I uninstalled codeblocks and reinstalled it, but even that did not solve the problem. I'm afraid I may have accidentally erased the compiler, but I don't know how I might have been foolish enough to do that.

Help, please! I'm currently with a team developing a game and this problem has happened at what is literally the worst possible time!
Logged
Ceniza
Developer
Lives here!
*****
Offline Offline

Posts: 1442



WWW
« Reply #1 on: September 11, 2010, 08:47:57 am »

The biggest problem is that you did not search for an answer. The problem you are getting is perhaps the most common one people get, specially newbies. All moderators and some users are quite pissed already having to read over and over the same question. Instead of an answer, all of you receive is a very unkind welcome to the forums because you did not follow the rules (search before posting + provide relevant information).

Just try searching for "uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]" and you will see what I am talking about. I get 8 pages of the same thing. People asking over and over and over again (I even think that many of those questions were deleted). 8 pages of that have become noise in the forums, and those few who search will have to go through many posts before they can reach the answer.

I have already said here that the error message that Code::Blocks shows to the user is vague, and, specially, confusing to new users. The message has been changed in an attempt to make it clearer, but I still believe it is not clear enough.

Guide to an answer:

The message says that there is a chance that something is not correctly configured in the compiler options: the toolchain path. If you go to the compiler options there is a tab somewhere with the paths and names of the tools that make up for the whole compiler suite. You must check that the path is correct, that it points to an existent location, and that the names of the compiler tools name executables in the bin folder of that path.

You said you uninstalled programs, so there is a chance that the path to the compiler is no longer valid. Maybe it was pointing to an old compiler you just deleted, or something.

Please, check that information, try again, and report back what was wrong (what was the path before, what it should be, was a tool name not found, ...).

Also, please, do search before posting (as a general rule here and everywhere else).
Logged
flubberknuckle
Newcomer
*
Offline Offline

Posts: 2


« Reply #2 on: September 11, 2010, 09:11:34 am »

Problem resolved. Thank you, Ceniza, for putting up with me, and sorry for being a newbie. The problem was as you said; codeblocks was using my old compiler.

When I went to Settings > Compiler and debugger > Toolchain executables, I saw that the compiler directory was set to Dev-Cpp, which was definitely not the right one. Somehow I changed the directory when I uninstalled Dev C++.

Anyway, I clicked auto detect and voila, fixed. Thanks again.

Logged
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #3 on: December 28, 2010, 03:03:49 am »

So I've come up with the same problem.
I go to the Toolchain executables tab and hit autodetect which sets the directory to a MinGW directory (C:\Program Files (x86)\CodeBlocks\MinGW) which contains a bin directry which contains all of the files listed beneath (mingw32-gcc.exe, ar.exe,...).
I've added bin to the "Compiler's installation directory" path.
I've downloaded the GCC compiler (http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm64-gcc-4.5.1.exe/download) and installed it in a different location and pointed "Compiler's installation directory" to the new location.
I've tried adding the bin directory to the new path.
I've entered the full path name for each program in the Program Files tab and removed the "Compiler's installation directory" entry.
I've hit "Reset defaults".
I've rebooted.

None of these worked, I still get the 'Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!].' error message.
OS-Windows XP Pro 64-bit 2003 sp2
C::B 10.05 downloaded today.

Logged
stahta01
Lives here!
****
Online Online

Posts: 4432


WWW
« Reply #4 on: December 28, 2010, 04:59:36 am »

@eb:

Please state the Compiler Name and version of the Compiler used for the following questions?
Please state the full path to the Compiler?
Please state the path you tried in Code::Blocks?
Note: Code::Blocks adds the bin folder to the path you set; so, do NOT have the bin folder in the tool chain path.

Tim S.
« Last Edit: December 28, 2010, 05:01:10 am by stahta01 » Logged

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org/index.php?title=Main_Page
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #5 on: December 28, 2010, 10:19:50 pm »

compiler: 
Not sure of the name and version but the name of the installer is "tdm-mingw-1.908.0-4.4.1-2.exe".

Path of the compiler:
Not sure about this either but mingw32-g++.exe (the GNU GCC Compiler I assume) and all the other files listed under the Program Files tab under the Toolchain Executables tab are located in "C:\Program Files (x86)\CodeBlocks\MinGW\bin\" according to Windows Explorer (as opposed to where C::B is theoretically looking).

Path I tried in Code::Blocks:
The Compiler's installation directory is set to "C:\Program Files (x86)\CodeBlocks\MinGW"
Logged
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #6 on: December 28, 2010, 10:42:59 pm »


I don't know if this helps but when I place the cursor at the end of main.cpp (the program that was created upon installation) and hit the "Run to cursor" icon I get this error message:

Build succeeded
Selecting target:
Debug
ERROR: You need to specify a debugger program in the compiler's settings.
(For MinGW compilers, it's 'gdb.exe' (without the quotes))
(For MSVC compilers, it's 'cdb.exe' (without the quotes))

[Settings][Compiler and debugger...][GNU GCC Compiler][Toolchain executables][Debuggeer:] = gdb.exe
"C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb.exe" is there.
Logged
stahta01
Lives here!
****
Online Online

Posts: 4432


WWW
« Reply #7 on: December 28, 2010, 10:50:42 pm »

@eb:

So, it is NOW compiling; but, debugger is not working.
I can not help with debugger; I never use it.

Tim S.
Logged

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org/index.php?title=Main_Page
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #8 on: December 28, 2010, 11:33:26 pm »

It's not doing anything.  It simply says "Nothing to be done".  No window opens saying "Hello World!"
Logged
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #9 on: December 28, 2010, 11:40:52 pm »

"Build Succeeded"
Does this mean that it works?
Does it create a .exe file somewhere that I can run?  Because when I hit the run button it opens a window entitled "Information" which says "It seems that this project has not been built yet. Do you want to build it now? [Yes][No][Cancel].
This is AFTER I receive the above "Build Succeeded" message.
Logged
stahta01
Lives here!
****
Online Online

Posts: 4432


WWW
« Reply #10 on: December 28, 2010, 11:46:02 pm »

Turn ON Full Compiler Logging and post full Rebuild Log; Note: This means do a Rebuild and Post "Build Log" NOT "build Messages".

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.
« Last Edit: December 28, 2010, 11:47:45 pm by stahta01 » Logged

C Programmer working to learn more about C++.
Compiling CB Trunk against wxWidgets WX_3_0_BRANCH branch.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org/index.php?title=Main_Page
oBFusCATed
Developer
Lives here!
*****
Offline Offline

Posts: 7664


« Reply #11 on: December 28, 2010, 11:52:18 pm »

Things to try:
1. Open a cmd.exe
2. cd to the folder with the compiler
3. execute g++ --version
4. execute gdb --version

If that works check if the path is the same in the C::B's settings.

It is obvious that C::B can't find you compiler, nor your debugger (gdb.exe)
Logged

<debugger plugin maintainer>
(most of the time I ignore long posts)
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #12 on: December 28, 2010, 11:56:21 pm »

Ein minuten bitte!!!

I have been opening this project via [File][Recent projects] and I just noticed that even though I did a [Save project as...] to a new location it was still looking at/for main.cpp in it's original location.  So instead I double-clicked (opened) main.cpp in it's new (current) location and BADDA-BING it works: no errors and I get the window.

If you got an explanation about what you think I did wrong I'd love to hear it.
If not then thanks for baby sitting me through this.
Logged
oBFusCATed
Developer
Lives here!
*****
Offline Offline

Posts: 7664


« Reply #13 on: December 29, 2010, 01:28:05 am »

Can you reproduce it again?
Logged

<debugger plugin maintainer>
(most of the time I ignore long posts)
eb
Advanced newcomer
*
Offline Offline

Posts: 43


« Reply #14 on: December 29, 2010, 02:38:20 am »

Yes. 
I closed C::B,
I started C::B,
I go [File][Recent Project]
I select what is now the only project in the list.
I click on Sources under Projects in the Management window.
I double click main.cpp and get the main.cpp with the code to the right.
Then I click on the 'Build and run' icon and it throws the error message - "second - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
Nothing to be done.
I right click on main.cpp in the Management window to check Properties and main.cpp is in the proper (new) location.  The same for the project under [File][Recent Project].  And it's still the same if I start C::B by double clicking project's icon in Windows Explorer.

HOWEVER if I start C::B by double clicking the main.cpp icon in Windows Explorer and click on the "Build and run" icon it works.

Of course now there is a main.exe file that opens a DOS window and says "Hello World" (among other things) but closes before I hit a keyboard button.
Logged
Pages: [1] 2  All   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!