Author Topic: Code::Blocks won't let me compile  (Read 33872 times)

osxi

  • Guest
Code::Blocks won't let me compile
« on: July 07, 2009, 07:23:27 am »
Windows XP

File>Open>Practice.cpp
Build>Build (nothing happens)
Build>Compile current file (nothing happens)
Build>Build and Run ... (nothing happens

File>Quit Code Blocks

Run Bloodshed Dev C++

File>Open>Practice.cpp

Compile and run (Works great!!!)

I love the way that Code::Blocks looks and everyone told me that it was way better than Dev C++, but if Dev will actually let me do something with it (like compile and run a source file) and Code::Blocks won't, then it's of no use to me.
« Last Edit: July 07, 2009, 07:27:42 am by osxi »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks won't let me compile
« Reply #1 on: July 07, 2009, 10:09:56 am »
Why don't make a project for the file?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

osxi

  • Guest
Re: Code::Blocks won't let me compile
« Reply #2 on: July 07, 2009, 12:38:43 pm »
I tried.  It says "invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]... Skipping"  I've tried every compiler under Settings>Compiler and debugger..., and everything says the same thing.  *Sigh*, I'm surprised this hasn't happened to anyone else.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Code::Blocks won't let me compile
« Reply #3 on: July 07, 2009, 01:23:49 pm »
Setup the toolchain for the compiler you use correctly, don't forget the Compiler's installation directory (without the bin).

And next time search before you ask questions that have been answered tons of time.
search for "invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]... Skipping"

Posts like that (asking quetsions that are not related to C::B or asking questions that have been answered many times before) normally get tlocked or silently deleted.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Code::Blocks won't let me compile
« Reply #4 on: July 07, 2009, 01:30:41 pm »
I tried.  It says "invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]... Skipping"  I've tried every compiler under Settings>Compiler and debugger..., and everything says the same thing.
Well, that error message might give you a good hint. Obviously, if the IDE doesn't know what compiler executable to invoke, it won't do it.
First of all, do you have a compiler installed at all? And if you do, check that the path to it is set properly in compiler options. Also, if you use a compiler with only non-standard executable names (such as "gcc-i686-foo-bar-DW2.exe" or something), make sure that you either configure the executable names properly in the compiler settings dialog as they appear, or alternatively make a junction with a generic name "such as "gcc.exe") to the real program. Instead of a junction, a copy will do, too.
The whole point is, whatever you tell Code::Blocks to look for, it must be able to find that.

Dev-CPP is made so every monkey can use it, but that is no surprise, as it comes with its own version of MinGW bundled, and it's preconfigured to work with exactly this one constellation, and nothing else.
You can have that with Code::Blocks too, if you select the right option in the installer. In addition, Code::Blocks will also detect most properly done installations of MinGW by itself (unless you prevent the installer from writing to the registry).
What it can't (or rather, won't) do is find the right compiler out of possibly a million files on your hard disk if neither there are any registry hints, nor the compiler is in its default location, i.e. some unknown compiler version that you either unzipped manually or that happens to be inside Dev-CPP's folder.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks won't let me compile
« Reply #5 on: July 07, 2009, 02:18:51 pm »
Windows XP

File>Open>Laber.cpp

Build>Build
--> Compiles just fine.

Build>Compile current file
--> Compiles just fine.

Build>Build and Run ...
--> Compiles and runs just fine.

All is OK. Now guess what's wrong about your post.
ONE hint I'll, give you: Search the forums. The others you'll have to figure out yourself. Topic locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ