Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux-native C libraries: How to configure Visual Studio Code to work with them on Windows?

total noob here.

There are a few a few C libraries I would like to use, like unistd.h and sys/time.h, in a Windows machine. I have found many threads discussing is it simply not possible without using alternative packages. But I wonder does the Windows Subsystem for Linux come with those libraries? If so, how do I configure Visual Studio Code work with WSL?

like image 509
karmstr7 Avatar asked Jan 01 '26 14:01

karmstr7


1 Answers

But I wonder does the Windows Subsystem for Linux come with those libraries?

Yes compiler in WSL will contain these headers.

If so, how do I configure Visual Studio Code work with WSL?

You need to enable WSL in Windows features, install linux distro you like via Microsoft Store, install "Remote - WSL" extension in VS Code. More information can be found here: https://code.visualstudio.com/docs/remote/wsl

Keep in mind though, that applications that you will compile in this setup will be linux applications. They will only be able to operate under linux or WSL. There is no way you can compile applications using these libs for Windows. These libs are platform depended.

like image 142
Ozicom23 Avatar answered Jan 03 '26 03:01

Ozicom23



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!