You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uyplayer@UYPLAYER-PC:~/linux/ldd3$ make
for n in misc-progs misc-modules skull scull scullc scullp lddbus sculld scullv shortprint simple tty pci usb sbull snull short; do make -C $n || exit 1; done
make[1]: Entering directory '/home/uyplayer/linux/ldd3/misc-progs'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/uyplayer/linux/ldd3/misc-progs'
make[1]: Entering directory '/home/uyplayer/linux/ldd3/misc-modules'
make -C /lib/modules/5.10.16.3-microsoft-standard-WSL2/build M=/home/uyplayer/linux/ldd3/misc-modules modules
make[2]: Entering directory '/home/uyplayer/linux/ldd3/misc-modules'
make[2]: *** /lib/modules/5.10.16.3-microsoft-standard-WSL2/build: No such file or directory. Stop.
make[2]: Leaving directory '/home/uyplayer/linux/ldd3/misc-modules'
make[1]: *** [Makefile:20: modules] Error 2
make[1]: Leaving directory '/home/uyplayer/linux/ldd3/misc-modules'
make: *** [Makefile:10: subdirs] Error 1
The text was updated successfully, but these errors were encountered:
uyplayer
changed the title
how to compile in microsoft-standard-WSL2 ?
when I compile this project using **make** command in **WSL** , unable to compile
Sep 23, 2023
uyplayer
changed the title
when I compile this project using **make** command in **WSL** , unable to compile
does this project support to compile on WSL ?
Sep 23, 2023
@uyplayer You may have already discovered your answer after a year, but I will explain to others who may have encountered the same error.
The problem with your build process is that /lib/modules/5.10.16.3-microsoft-standard-WSL2/build doesn't exist. This path must include either a symlink or the directory of your Linux kernel source code (containing only the header files should be fine as well). If you had an ordinary Linux distribution you could install a package called linux-headers*, but the version matters, and in WSL2 they use a fork of the Linux kernel, not the mainline one.
Unfortunately, WSL2 does not contain its kernel header files in any of its repositories, therefore you can't compile a kernel module with your default kernel. Packages such as linux-headers-$KVERmight work for some cases if you create a symlink manually to what it installs (perhaps? haven't tried it, but it should be fine for the purpose of this repository I believe).
And of course, if linux-headers-$KVER does not work for you, you can clone this repo and build your own kernel. This makes module development much easier (you can setup auto-complete stuff as well with the gen_compile_commands.py script). You can read the build instructions from here.
The text was updated successfully, but these errors were encountered: