Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Examples in local libraries? (Read 143 times)
NF1Z
Junior Member
**
Offline



Posts: 10
Examples in local libraries?
Feb 12th, 2019 at 5:18pm
 
Hi Tim,
I have a project I have been developing for several years now,  with several builds that share some code.  I was using Arduino libraries, but it seemed to me a better solution in my situation would be local libraries.  I recently made a couple of small changes to a library and wanted to check it with a previous example sketch I had written for that purpose.  I found that the example sketch, now moved to:
<sketchbook>\<sketch>\_micro-api\libraries\<lib>\Examples\demo\ demo.ino

compiles but gives me the following linker errors:

ccPch99Z.ltrans0.ltrans.o*: In function main
main.cpp:43: undefined reference to setup
main.cpp:46: undefined reference to loop

The same sketch in the original location:
<sketchbook>\libraries\<lib>\Examples\demo\ demo.ino

compiles and runs fine.  The contents of the two locations (i.e., below _micro-api\libraries and below the sketchbook libraries folder ) are identical, and of course there are loop() and setup() functions.

I can send you further info, but before that, is there a simple answer - like "not supported", or some project setting?  I can't immediately see any reason why this doesn't work, so suggestions welcomed.

Regards,
Jed
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 9816
United Kingdom
Re: Examples in local libraries?
Reply #1 - Feb 12th, 2019 at 7:07pm
 
I would recommend using shared projects instead of local libraries. This allows the library to exists outside of another project folder. each examples below shared libraries can then be opened as projects in the solution explorer.

Solution Folder
Projects\Project1
Libraries\Library1
Libraries\Library1\Examples\Example1Project1

Alternatively shared projects can of course also point to a library in the normal sketchbook\libraries folder which would make it easier for other projects to also use the library without need to configure the shared project reference.

Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print