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....
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
BSEC linking not working correctly (Read 1254 times)
JamesFarmer
Junior Member
**
Offline



Posts: 41
BSEC linking not working correctly
Mar 1st, 2020 at 3:41pm
 
my program builds fine directly in Arduino IDE but not linking correctly inside VM please see two files attached for Verbose.

VM is from visual studio Micro
Arduino txt is strait from the Arduino IDE

I have made edits to the platform.txt file and linker files but as it look in verbose they both using same location or are they
Back to top
« Last Edit: Mar 1st, 2020 at 4:42pm by JamesFarmer »  

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



Posts: 10894
United Kingdom
Re: BSEC linking not working correctly
Reply #1 - Mar 2nd, 2020 at 12:41am
 
Please try the next release of visual micro (20.03.01.1) which has more intelligent insert point when adding missing prototypes to the temp build code.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
JamesFarmer
Junior Member
**
Offline



Posts: 41
Re: BSEC linking not working correctly
Reply #2 - Mar 2nd, 2020 at 9:56pm
 
Tim, Same thing nothing changed,  is there something I need to change somewhere. A setting or such

This is response from the library company how can I add this flag  in Arduino I just edited the platform.txt file to link this correctly but appears this does not use the same file

"Undefined reference to" BSEC functions is typically due to linking issues. In particular, I don't see the BSEC library being part of the linker flags in you snippet (i.e. at least "-lalgobsec" seems missing, eventually including its directory may be needed too). Adding this flag should (as required by your specific toolchain) should solve this issue
Back to top
« Last Edit: Mar 2nd, 2020 at 10:10pm by JamesFarmer »  
 
IP Logged
 
JamesFarmer
Junior Member
**
Offline



Posts: 41
Re: BSEC linking not working correctly
Reply #3 - Mar 2nd, 2020 at 10:15pm
 
please the attached file this is what i changed to get the Arduino IDE working but it appears VM is not using the same files
Back to top
 

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



Posts: 10894
United Kingdom
Re: BSEC linking not working correctly
Reply #4 - Mar 3rd, 2020 at 9:35am
 
Please zip and email your project. Can you also confirm if you have a MainMode0.cpp in the project? If you do then rename it to something else.

I see this in the output which might mean something to you but I would like to see the source.

variable.cpp:1: In file included from
variable.h: 1:17: warning: extra tokens at end of #ifndef directive
   #ifndef variable.h
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
JamesFarmer
Junior Member
**
Offline



Posts: 41
Re: BSEC linking not working correctly
Reply #5 - Mar 7th, 2020 at 4:43am
 
I thought it was working but it was not please see attached
I took same program and tried to build in both visual micro and Arduino

Arduino is working fine
Visual Micro is having linking issues with a precompiled library

please to outputs from builds  I have attached .ino code as well

this linking script is missing in the visual micro

if you look at the second line after linking everything together you will see it missing

"-LC:\\Users\\Home\\Documents\\Arduino\\libraries\\bsec\\src\\esp32" -lalgobsec -Wl,--end-group -Wl,-EL -o
Back to top
« Last Edit: Mar 7th, 2020 at 5:30pm by JamesFarmer »  

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
JamesFarmer
Junior Member
**
Offline



Posts: 41
Re: BSEC linking not working correctly
Reply #6 - Mar 7th, 2020 at 4:44am
 
code
Back to top
 

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



Posts: 10894
United Kingdom
Re: BSEC linking not working correctly
Reply #7 - Mar 7th, 2020 at 8:23pm
 
Thanks very much for this post. We had missed the "recent" library.properties facility that specifies the library has mcu specific additional precompiled .a and .so files. These are now supported in the latest release for VS that can be downloaded here.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

The Atmel studio releases will also be refreshed to include this change during the next 24 hours.

That causes the linker error.

One point of note is that the library.properties for the library you are using specifies an extra linker flag but honoring the property causes the build to fail due to the flag being invalid. I notice the arduino ide is ignoring this property so it is ignored in visual micro.  If you find that it is required but only for certain types of boards then you can force visual micro to use library linker flags by adding this prop0erty to a local project board.txt or toolchain.
Code:
vm.build.use_lib_linker_more_flags=true 

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
JamesFarmer
Junior Member
**
Offline



Posts: 41
Re: BSEC linking not working correctly
Reply #8 - Mar 9th, 2020 at 12:48pm
 
The latestest has fixed this issue doing the upgrade
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10894
United Kingdom
Re: BSEC linking not working correctly
Reply #9 - Mar 9th, 2020 at 6:51pm
 
Great, thanks again for the report.
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print