Forum: µC & Digital Electronics Atmel Studio: how to change compiler output directory?

Author: Markus Grabner (grabner)
Posted on:

Rate this post
0 useful
not useful

I have two projects in one Atmel Studio 6.1 solution which share some 
source files, but are compiled for different controller types. When one 
project is compiled, the resulting object files are unusable for the 
second project since the object files are stored at the same location 
for both projects. This could easily be solved by specifying different 
object file directories for the two projects.

In Visual Studio (which Atmel Studio is based on), one can freely choose 
the output directory, but I couldn't find a similar option in Atmel 
Studio. Does anybody know how this can be done in Atmel Studio (either 
in the IDE or by some compiler options)?

Thanks & kind regards,

Author: Jacy Jung (Guest)
Posted on:

Rate this post
0 useful
not useful
Oh, I faced this problem so often :)

I would recommend you creating one directory, call it eg. "project". In 
this directory you create a subdirectory "universal" with files that are 
independent from the controller type. In that "universal" directory you 
have one entry file, for example "universal.c" which includes all 
necessary headers and files.

Then, create a second subdirectory in the "project" directory, call it 
eg. "ATMega8". In this directory you create a project that uses the 
specific controller (in this case ATMega8). In the "main.c" you #include 
the "universal.c". For this, you have to add the directory path 
"..\..\universal" in the compiler settings.

Like this, you can create multiple other subdirectories in the "project" 
folder for other controller types and you don't have to create redundand 

I hope I explained it understandable :)


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.