Hello
I have an issue adopting an existing working project into Atmel Studio 7 with Visual Micro.
I have a lot of 'not declared' and 'incomplete type' errors upon compilation.
The project structure is something like this:
arduino_folder\my_project\my_project.ino
arduino_folder\my_project\another_file_1.ino
arduino_folder\my_project\another_file_2.ino
arduino_folder\libraries\arduino_library_1\arduino_library_1.h
arduino_folder\libraries\arduino_library_1\arduino_library_1.cpp
arduino_folder\libraries\arduino_library_2\arduino_library_2.h
arduino_folder\libraries\arduino_library_2\arduino_library_2.cpp
The errors arise within a set of libraries (individual classes in this case) I wrote myself in C++ where a class lib references another lib class, e.g. class referenced within arduino_library_1.h references the class type within arduino_library_2.h.
I have tried:
*adding "class prototype;" in header files,
*adding "#include xxx" to both .h and .cpp files
*explicitly adding each library subfolder as a -I option in the project properties
*different combinations of the above
Unfortunately nothing results in correct linking of the files.
I suspect that it is something to do with the #ifndef/#define single inclusions I have within the headers, but as mentioned before this was working before in Arduino IDE, and also I see from the blurb at the bottom of this Visual Micro page, it should operate in a similar manner:
http://www.visualmicro.com/page/Arduino-for-Atmel-Studio.aspx Quote:All required libraries must be #included in the project_name.ino, regardless of their use only in .cpp sources. All library #includes will be linked regardless of preprocessor #conditions. This is historically how Arduino has worked and also applies to Visual Micro for Visual Studio 2010.
So my theory is that '#conditions' are in fact taken into account meaning my #ifndef/#define single inclusions are somehow breaking the compilation.
Any ideas?