skeeto / w64devkit

Portable C and C++ Development Kit for x64 (and x86) Windows
The Unlicense
3k stars 211 forks source link

Add libraries to VSCode #22

Open PacifiK2460 opened 2 years ago

PacifiK2460 commented 2 years ago

Excelent tool, gcc and make are working as expected, but in VSCode I get errors about stdio.h and relatives libraries (VSCode complains about not finding them), how can I add w64devkit to the VSCode include path?, I alreay added the include and derivates folders but looks like VSCode is missing something...

skeeto commented 2 years ago

Make sure you add the correct include/. There's an empty, vestigial include/ just inside w64devkit — I should probably remove it before packaging so that it doesn't mislead — and the real include/ is at "x86_64-w64-mingw32/include" (or i686-… for 32-bit). GCC can print its sysroot which will show you this path regardless of where you unzipped w64devkit (useful in scripts):

echo "$(gcc -print-sysroot)/include"

(I'm surprised the VSCode "C/C++ extensions" can't find it on its own given that it can trivially interrogate GCC for its location.)