Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Including unwanted object files (Read 1493 times)
Bob Jones
Full Member
***
Offline


Posts: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Including unwanted object files
Aug 7th, 2019 at 6:10pm
Print Post  
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.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Including unwanted object files
Reply #1 - Aug 7th, 2019 at 6:16pm
Print Post  
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: 210
Location: Bellingham, WA
Joined: Dec 4th, 2015
Re: Including unwanted object files
Reply #2 - Aug 7th, 2019 at 6:19pm
Print Post  
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
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Including unwanted object files
Reply #3 - Aug 7th, 2019 at 6:21pm
Print Post  
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 TopicPrint