Author Topic: Changing Name of Executable File When Building from Within C::B  (Read 8028 times)

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Hi again;
I wanted to know how to change the name of an executable file created in Code::Blocks (language is C++) while Building the program within the IDE itself. 

I ask because the executable file in my project is being given a different name than the .cpp file that is creating it.  (Note: I changed the .cpp file to be the same name as the project, which in this case is input_letter.cbp and input_letter.cpp, but I had to modify and already existing .cpp file to get the current one and I think the problem is being inherited from there).

I'll try to fix it by deleting the project and making it again (I'll copy-paste the source code) but I'd also like to know if there's a way to just change the name C::B gives the executable file.  Isn't there some way to access the command-line through C::B and change it that way?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Changing Name of Executable File When Building from Within C::B
« Reply #1 on: April 04, 2015, 09:32:51 am »
"Project -> Properties -> Build targets -> [your target(s)] -> Output filename".

Offline DragonOsman2

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Changing Name of Executable File When Building from Within C::B
« Reply #2 on: April 04, 2015, 09:42:57 am »
Alright, thanks a bunch.

By the way, is it important to include those "bin" and "Release" folders in there as well, or is it okay to not let it create them at all? 

I mean, wouldn't it be better to have the .o and .exe files in the same folder?  That's also how the Command Prompt does it when we do it all from there, after all.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Changing Name of Executable File When Building from Within C::B
« Reply #3 on: April 04, 2015, 03:05:16 pm »
I mean, wouldn't it be better to have the .o and .exe files in the same folder?  That's also how the Command Prompt does it when we do it all from there, after all.
this is entirely up to you. However, if you ship your application you won't need the "*.o" files (these are object files and linked into the "*.exe" application file). So to keep the executable folder clear I'd choose a different one.

Please read yourself a little more into how a compiler and linker works. This question is hardly related to Code::Blocks but more that you did not understand what the compiler and linker produces. Unfortunately this is far beyond the scope of this forum. Luckily there are plenty other forums around that deal with basic programming.
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