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 Error linking for board Arduino (Read 2624 times)
StepJohn
Newbies
*
Offline


Posts: 1
Joined: Jan 1st, 2018
Error linking for board Arduino
Jan 1st, 2018 at 6:27pm
Print Post  
I have a multi-project solution built in Visual Studio 2015.
Most of the projects are libraries, set to build as static .lib.
I have a test project which, when set as the startup-project, tests the project libraries in windows.
I also have an Arduino project which I created by importing a .ino sketch.
When set as the startup-project, this .ino project tests the libraries on a microcontroller.
Both of these projects have project references to the library projects they depend on.
I have successfully built and run my test project, but when I try to build the Arduino Project, I get linker errors such as this:
Code (C++)
Select All
Compiling debug version of 'SJD_NewHeatingSystem' for 'Arduino/Genuino Mega w/ ATmega1280'

cc1GsQfP.ltrans0.ltrans.o*: In function __base_ctor

Error linking for board Arduino/Genuino Mega w/ ATmega1280
Relay.h:7: undefined reference to vtable for HardwareInterfaces  RelaysPort
Relay.h:7: undefined reference to vtable for HardwareInterfaces  RelaysPort
Debug build failed for project 'SJD_NewHeatingSystem' 


See the attached picture for my projects and references.

Any ideas why the linker is not seeing the object files for the referenced projects?
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error linking for board Arduino
Reply #1 - Jan 2nd, 2018 at 12:45pm
Print Post  
You need to be careful using the word "library". Arduino libraries are quite different to c++ libraries.

Arduino does not normally support references to other projects however visual micro provides some extra capability here and visual studio has some specific functionality we use called "shared c++ projects".

You should put your shared code in projects then when you add a reference you will find them on the "shared projects" tab.

http://www.visualmicro.com/post/2017/01/16/Arduino-Cross-Platform-Library-Develo...


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