wkz / mdio-tools

Low-level debug tools for MDIO devices.
GNU General Public License v2.0
66 stars 31 forks source link

bus.c:4:24: fatal error: linux/mdio.h: No such file or directory #15

Closed vredzhepov closed 2 years ago

vredzhepov commented 2 years ago

commit 83216892bba936b83a62ea552b4ce66c459ec9a0

make all-recursive make[1]: Entering directory '/tmp/mdio-tools' Making all in man make[2]: Entering directory '/tmp/mdio-tools/man' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/tmp/mdio-tools/man' Making all in src make[2]: Entering directory '/tmp/mdio-tools/src' Making all in mdio make[3]: Entering directory '/tmp/mdio-tools/src/mdio' CC mdio-bus.o bus.c:4:24: fatal error: linux/mdio.h: No such file or directory compilation terminated. make[3]: [Makefile:385: mdio-bus.o] Error 1 make[3]: Leaving directory '/tmp/mdio-tools/src/mdio' make[2]: [Makefile:311: all-recursive] Error 1 make[2]: Leaving directory '/tmp/mdio-tools/src' make[1]: [Makefile:411: all-recursive] Error 1 make[1]: Leaving directory '/tmp/mdio-tools' make: [Makefile:331: all] Error 2

troglobit commented 2 years ago

Hi, maybe you can tell us a little bit about your system? Is it a desktop Linux system, if so what distro are you using, what kernel version do you have?

As you maybe have gathered, the projects requires Linux kernel header files to build, the particular file you are reporting missing was added to Linux in 2009, so I'm guessing you just don't have the matching header files for your system installed.

For instance, on a Debian/Ubuntu system you need to sudo apt install linux-libc-dev before you can build. If you are cross-compiling for an embedded system there are other concerns to be taken, but this is difficult to speculate about with this little information.

vredzhepov commented 2 years ago

Hello @troglobit

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"

5.13.0-48-generic

The error log that I posted I received when I tried to cross compile this utility but when I tried to compile it for x86_64 there're no errors. Seems I've to set some additional environment variables in order to cross compile it successfully. So I have no more questions regarding this issue.

Thank you for help.