PlatformIO Error on link process - cannot find -lalgobsec

Let me return the original script to try to explain for you the original link error message. It is below:

Blockquote

[env:wiscore_rak4631]
platform = nordicnrf52
board = wiscore_rak4631
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
build_flags = -lalgobsec
lib_deps =
SX126X-Arduino
ArduinoModbus
closedcube/ClosedCube [email protected]^1.1.2
boschsensortec/BSEC Software [email protected]^1.6.1480
upload_port = COM[17]
upload_speed = 115200
[platformio]
description = RAK1906 - temp.-hum-press-airq, RAK1903 light, RS485 modbus, LoRaWAN

Blockquote

Blockquote

Linking .pio\build\wiscore_rak4631\firmware.elf
c:/users/claudio rosa/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/7.2.1/…/…/…/…/arm-none-eabi/bin/ld.exe: cannot find -lalgobsec
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\wiscore_rak4631\firmware.elf] Error 1
================================================================= [FAILED] Took 18.08 seconds =================================================================
The terminal process “C:\Users\Claudio Rosa.platformio\penv\Scripts\pio.exe ‘run’” terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Blockquote

It would have been preferable if you had kept this in your existing thread on this difficulty rather than creating a new one

Sorry, but you are mixing two differents cases in two differents environments:

  1. This case is the a WisBlock solution (RAK1906+RAK1903) but with PlatformIO IDE, where I am receiving the error message that you metioned and you got in the other case “Error on link process - cannot find -lalgobsec”
  2. The other case was in Arduino IDE environment, and Bernd fixed it;

I am trying to move from Arduino IDE to PlatformIO IDE, and I already understood the PlatformIO is a powerful tool but I need to configure all requirements for compilation and linkedition and it is not so obvious :smiley:

May I am wrong but I think that I have to clean the PlatformIO IDE environment, for example remove any pointer to Arduino IDE environment like this:“lib_extra_dirs = ~/Documents/Arduino/libraries”

That’s likely to break things, not fix them.

But you may need to explicitly add a -L flag for the directly where the correct copy of algobsec.a resides

Chris,

Sorry, but you got me wrong, I am trying to learn how this compiler and linkeditor works. The first thing for me is to ask when I am not understanding.

If you go to the Compliler/Linkeditor manual, you will see a lot of options but they don´t explain clearly what is the best option for each case:
For example:

Blockquote
[env:wiscore_rak4631]

platform = nordicnrf52

board = wiscore_rak4631

framework = arduino

lib_deps =

**boschsensortec/BSEC Software [email protected]^1.6.1480**

closedcube/ClosedCube [email protected]^1.1.2

Blockquote

In the PlatformIO Console Library, if you want to work with a library, the result will be a new entry in the platformio.ini in the “lib_deps =”. For me, it should be enough, I mean without a necessity to declare a “build_flags =”. As you can see below:

Am I wrong?

Hu!!! :sweat_smile:

IT IS WORKING :upside_down_face:

Maximilian Gerhardt found the solution and it is implemented at PlatformIO.ini

Have a good night!

Blockquote

[env:wiscore_rak4631]
platform = nordicnrf52
board = wiscore_rak4631
framework = arduino
lib_deps =
SX126X-Arduino
ArduinoModbus
closedcube/ClosedCube [email protected]^1.1.2
boschsensortec/BSEC Software Library @ ^1.6.1480
; valid for cortex-m4 cores compiled with hard floating point option.
; environment name needs to be adapted if used in a different platformio.ini
build_flags = -L".pio/libdeps/wiscore_rak4631/BSEC Software Library/src/cortex-m4/fpv4-sp-d16-hard"
upload_port = COM[17]
upload_speed = 115200
[platformio]
description = RAK1906 - temp.-hum-press-airq, RAK1903 light, RS485 modbus, LoRaWAN

Blockquote

That is exactly an example of “you may need to explicitly add a -L flag for the directly where the correct copy of algobsec.a resides”

If you go to the Compliler/Linkeditor manual

You’re confusing the IDE and build driver (platform.io) with the compiler/linker (gcc)

-L and -l are arguments to the linker, of course it has no idea how your project is set up, which is why you have to tell it what library you need with -lalgobsec and -L<path> Given that you aren’t invoking these tools on the command line but through the IDE’s builder, you then have to put the flags in the correct lines in the IDE config.

Thank you anyway

Regards,

Claudio

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.