Author Topic: Auto-delete object files  (Read 3238 times)

Offline n0c0d3

  • Single posting newcomer
  • *
  • Posts: 2
Auto-delete object files
« on: November 20, 2012, 08:11:02 pm »

I'm new to C++ and was looking for an API to work with. CodeBlocks looks really great. But I am trying to compile some exercises and every time when I compile I get the object code in my directory. To avoid clutter I can easily delete those files of course but when I compile from the command line these are automatically deleted. This is somewhat more convenient as there are quite a few exercises and for the time coming the projects are all pretty small and every file needs to be compiled every time anyway wen I have bugs.

On the (Ubuntu) command line I use:
Code: [Select]
g++ -o <outputfile> <inputfile.cpp>
In CodeBlocks I think I found where to set the compiler  options and flags, but I can't figure  out what to do there. They're in Compiler and Debugger settings > Other Settings > Advanced options. There I can create a custom command line macro. I've tried several variations, but I always get a compile error: "/bin/sh: 1: Syntax error: Unterminated quoted string".
Amongst the options I've used is for example:

Code: [Select]
$compiler -o $exe_name -c $file
I'm on Ubuntu 12.10 x86-64 and use g++ 4.7.2

Does someone have an idea how to compile without being left with the object file?