User forums > Using Code::Blocks

Changing object file name

(1/1)

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.

--- End quote ---
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.

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

Tim S.

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

--- End quote ---
Indeed. I did't think of that at all.

Navigation

[0] Message Index

Go to full version