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
Including unwanted object files (Read 84 times)
Bob Jones
Full Member
***
Offline



Posts: 207
Bellingham, WA
Including unwanted object files
Aug 7th, 2019 at 7:10pm
 
I have a very complex build that gets compiled in different ways, depending on the device I am building. It could be a Mega-based robot, an Uno-based Remote Controller or even a Nano-based small robot. Each device has its own configuration file that defines what libraries this device needs. For example, a Robot device needs Servo.h and BJDriverL298N to control the motors. A Remote Controller, on the other hand may need code to manage a Joystick but does not need the Servo or L298N code.

The problem I am seeing is that modules I don't need (e.g. Servo) are being included in builds, thus increasing the size of the output file to the point where it is too big for the processor.

How do I instruct the linker to only include the libraries that are explicitly included in the files being compiled?

The attached zip file contains the verbose compiler output and the generated object file contents.
Back to top
 

OUTPUT_003.zip (13 KB | 0 )
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10395
United Kingdom
Re: Including unwanted object files
Reply #1 - Aug 7th, 2019 at 7:16pm
 
Are you using libraries as shared projects or just adding #include<> for libraries to your code?
Back to top
 
WWW  
IP Logged
 
Bob Jones
Full Member
***
Offline



Posts: 207
Bellingham, WA
Re: Including unwanted object files
Reply #2 - Aug 7th, 2019 at 7:19pm
 
I think a little bit of both. I have added explicit references to most libraries (NanoBot->Add->Reference) and each source file explicitly includes the libraries it needs.
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10395
United Kingdom
Re: Including unwanted object files
Reply #3 - Aug 7th, 2019 at 7:21pm
 
Maybe tbis is a bug with shared library references. remove the refrence and ensure the libraries are bwlow the  "mydocuments\arduino\libraries". If you move the libraries click then rescan or restart the ide.

With deep search enbabled only the #included libs should be compiled.

Does this work?
Back to top
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print