News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Changing object file name

Started by VCoder, March 06, 2010, 08:26:59 AM

Previous topic - Next topic

VCoder

hi everyone! i've just installed code::blocks on my ubuntu jaunty and have tweaked it to my liking. however, i haven't found the option to change the name of object file generated.

i'm a student and write mostly beginner level programs. i don't need the .o and executable files once my programs output the expected results. i want a way to change the name of the .o and executable files to a.o and a.out. For instance, when i compile palindrome.c, 2 files are generated-- palindrome.o and palindrome.out. is there a way so that the generated filenames are a.o and a.out. this way my home folder will not be cluttered with multiple .o and .out files.

i did try to change settings in Settings->Compiler and Debugger->Other settings->Advanced options...and changed the command to  $compiler $options $includes -c $file from $compiler $options $includes -c $file -o $object but it doesn't seem to work.

Any help would be appreciated. Thanks.

MortenMacFly

Quote from: VCoder on March 06, 2010, 08:26:59 AM
i did try to change settings in Settings->Compiler and Debugger->Other settings->Advanced options...and changed the command to  $compiler $options $includes -c $file from $compiler $options $includes -c $file -o $object but it doesn't seem to work.
If you replace $object with a.o and modify the linker command accordingly, too it should work. However - be careful! This completely breaks the build system if you want to use more than one object file.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

stahta01

A better option might be to use Code::Blocks with a custom makefile

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

MortenMacFly

Quote from: stahta01 on March 08, 2010, 06:24:58 PM
A better option might be to use Code::Blocks with a custom makefile
Indeed. I did't think of that at all.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]