Atmel Studio With Arduino Due

Hi!
How did you setup your project?
I am trying to set up a compiling project for two days now - without success.
First i tried the "Arduino Due/X - ATSAM3X8E" C/C++ template delivered with Atmel Studio. This creates a main.c and in the project properties only the c compiler is listed. I'd like to use the Arduino-library. Therefore i need a C++ compiler (right?). Any suggestions how to get him in there? Do you know what the template configueres?
---Didn't get the C++ compiler in :frowning: so i tried setting up a custom project

I started with the "GCC C++ Executable Project" Template and choose the ATMSAMX38E as device. Now i see the C++ compiler in the project properties. He got some additional informations:

  • the directories /variants/arduino_due_x, /system/libsam, and /sam/cores
  • the symbols ARDUINO=152, and F_CPU=84000000
  • the linker to the libcore.a - compiled for the Programming Port Arduino Due
  • i copy pasted the content of the Arduino-Software compiled .cpp into the main.cpp
    ---> and end up with 5 errors: "use of enum 'adc_resolution_t' without previous declaration", "use of enum 'adc_channel_num_t' without previous declaration"...in adc.h.
    So i visited adc.h and found a lof of lines like: "#if SAM3S_SERIES || SAM4_SERIES || ...." followed by definitions of the variables described in the errors. Could it be that i need to tell my code somewhere else that i use a SAM3X8E?

I got quite stuck here. Does anyone else have similar problems?
Thank you for your help!