Closed Reid-n0rc closed 1 year ago
Hello. I also experience the similar problem. I installed libbsd-dev
on my Ununtu 18.04 with no luck.
I tried the following suggestion w/o luck:
You can compile unmodified BSD source code by adding the following to your CFLAGS: -DLIBBSD_OVERLAY -I/usr/include/bsd, and linking with -lbsd.
https://stackoverflow.com/questions/61998682/making-strlcpy-available-in-linux
I'm not quite sure how strlcpy
will reference to libbsd
while the remaining parts will reference to newlib
.
Also just for reference: https://packages.ubuntu.com/bionic/amd64/libbsd-dev/filelist
Hi,
In file that is giving you warning regarding strlcpy, you should add #include
@kmihaylov @kbarilar That sounds weird. I added instructions to install libbsd-dev
/libbsd-devel
to fix this. It works on my Fedora installation.
Also, strlcpy()
does exist in the embedded libc library and where it's failing is only for the test code (template_test.c
), which is of course not required for compiling the firmware binary. But if you come up with a solution, please share your changes to the code here or in a PR!
So just to answer @kmihaylov too: The sonde firmware links with newlib indeed and it has got strlcpy() and it works correctly. The problem you see is with the test code that exercises the templating functionality. That will of course not use newlib and will need libbsd.
Also, even if compiling the test code fails, you already have the firmware built successfully and you can flash the binary. Tests are built after the firmware binary, so this issue doesn't prevent from flashing a sonde.
@kbarilar unfortunately it doesn't solve the problem for me. I did a fresh clone of the project. With the native settings it throws the error. Then I added <string.h>
in src/template.c
, completely removed build
dir, cmake
'd and the same error.
@mikaelnousiainen thank you for your response! Yes, I thought about it, there are RS41ng.bin .hex and .map files. It is annoying. Probably there is some little difference between Fedora/Ubuntu in handling library paths that leads to the problem. I'll try it tonight or tomorrow on another Devuan machine to see if there's any change.
I had the same issue with Ubuntu 20.04 LTS; I just commented out
# add_subdirectory(tests)
In CMakeLists.txt
Please use the new Docker environment for the build to avoid this issue. There are instructions in the README file on how to build the firmware using Docker.
I get an error when trying to compile. I have installed libbsd-dev and that helped with a previous error that
<bsd/string.h>
could not be found. It was my understanding that<bsd/string.h>
contained the functionstrlcpy
but it isn't working intemplate.c