Tiny Core Linux
Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: aus9 on April 18, 2023, 12:06:37 AM
-
error may read ....while compiling, ninja etc
error: implicit declaration of function ‘makedev’ [-Werror=implicit-function-declaration]
dev = makedev(major, minor)
above error will name filename
suggested solution
sed 's|sys/types.h|sys/sysmacros.h|' -i /pathway2/<filename.c>
ref
https://github.com/scylladb/dpdk/issues/3
This is due to the following change in glibc:
* The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. This
means that in a future release, the macros “major”, “minor”, and “makedev”
will only be available from <sys/sysmacros.h>.
-
Hi aus9
... suggested solution
sed 's|sys/types.h|sys/sysmacros.h|' -i /pathway2/<filename.c>
...
That command will remove sys/types.h and replace it with sys/sysmacros.h.
If filename.c depends on other includes or definitions from sys/types.h you will
introduce other errors.
Maybe something like this would be better:
sed 's|.*include <sys/types.h>|#include <sys/sysmacros.h>\n#include <sys/types.h>|' -i /pathway2/<filename.c>
If it finds include <sys/types.h> it replaces the entire line with:
#include <sys/sysmacros.h>
#include <sys/types.h>
-
thanks Rich
until I discovered the glibc issue, my compile was failing and my above line did succeed but happy to add a new line.
Looking at your command, and matching pattern, I think I found an easier command (easier for me at my coding level)
sed -i '1aline2' /pathway2/file.c
Which translates as find line number 1....insert a new line, after line specified, with a new line that has contents "line 2" into a certain file
its shorter and only needs a text editor with line numbers or someone who can count 8)