Visual Micro
https://www.visualmicro.com/forums/YaBB.pl
Other >> Other Hardware >> BSEC linking not working correctly
https://www.visualmicro.com/forums/YaBB.pl?num=1583077319

Message started by JAMESFARMER on Mar 1st, 2020 at 3:41pm

Title: BSEC linking not working correctly
Post by JAMESFARMER on 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
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=arduinotxt_001.txt (508 KB | )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VM_001.txt (463 KB | )

Title: Re: BSEC linking not working correctly
Post by Visual Micro on 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


Title: Re: BSEC linking not working correctly
Post by JAMESFARMER on 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

Title: Re: BSEC linking not working correctly
Post by JAMESFARMER on 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
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=Integration_Guidelines_for_Arduino_platforms.pdf (698 KB | )

Title: Re: BSEC linking not working correctly
Post by Visual Micro on 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

Title: Re: BSEC linking not working correctly
Post by JAMESFARMER on 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
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=visual_micro_not_working_001.txt (191 KB | )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=arduino_works_001.txt (402 KB | )

Title: Re: BSEC linking not working correctly
Post by JAMESFARMER on Mar 7th, 2020 at 4:44am
code
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=basic.zip (1 KB | )

Title: Re: BSEC linking not working correctly
Post by Visual Micro on 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[/code]

Title: Re: BSEC linking not working correctly
Post by JAMESFARMER on Mar 9th, 2020 at 12:48pm
The latestest has fixed this issue doing the upgrade

Title: Re: BSEC linking not working correctly
Post by Visual Micro on Mar 9th, 2020 at 6:51pm
Great, thanks again for the report.

Visual Micro » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2020. All Rights Reserved.