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 Linking to precompiled libraries (Read 4664 times)
JustinL
Newbies
*
Offline


Posts: 2
Joined: Jan 9th, 2015
Linking to precompiled libraries
Jan 9th, 2015 at 11:12pm
Print Post  
Hi,

I have been using VisualMicro for a while with no problems. Its been great.

However I now need to link to a thirdparty precompiled library as part of my project.

Looking at the verbose compile output, the linker is not being passed the library. 

Is there anyway I can force the linker commandline arguments as Amtel Studio options are ignored?

Or is there another way of forcing the linker to include the library?

At the moment I am just getting loads of "warning: undefined reference to"

Any help will be brilliant.

cheers,
Justin
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linking to precompiled libraries
Reply #1 - Jan 10th, 2015 at 1:17pm
Print Post  
Hi,

They are not catered for in the Arduino build process but we will shortly be providing a "convert to atmel" function that would make your arduino project a real atmel studio gcc project. That would then allow you more control but less vm help.

An alternative is to edit the avr\platform.txt below the arduino ide hardware folder and add your own {my_libs} variable to the appropriate build .pattern. Then edit the boards.txt and add your own board by copying and renaming an existing board. You can then add a key to the cloned board def such as 

Code
Select All
myboard.my_libs= 



In atmel studio then click tools>visual micro>reload toolchains or re-start the ide and select your new board.

Sorry it's a bit messy
« Last Edit: Jan 10th, 2015 at 1:19pm by Tim@Visual Micro »  
Back to top
IP Logged
 
JustinL
Newbies
*
Offline


Posts: 2
Joined: Jan 9th, 2015
Re: Linking to precompiled libraries
Reply #2 - Jan 10th, 2015 at 5:31pm
Print Post  
Hi,

Thanks for the quick reply. 

Editing the boards.txt as below:
build.variant_system_lib=libsam_sam3x8e_gcc_rel.a"  "C:\anotherlib.a

adds "anotherlib.a"  to the linker commandline perfectly.

Thanks for the help. 

cheers,
Justin 
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linking to precompiled libraries
Reply #3 - Jan 10th, 2015 at 9:29pm
Print Post  
Great, thanks for the update I will make a note of that for others

« Last Edit: Jan 10th, 2015 at 9:29pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint