วิธีแก้ไข “cannot open include file ‘stdio.h’: No such file or directory” ใน Visual Studio 2017
พอดีว่าผมเจอปัญหาตอนที่เขียน Dll ด้วย Visual Studio 2017 ซึ่งไม่เคยใช้มานานมากเป็นเกือบ 10 ปี ก็เลยเจอปัญหาเรื่องการไม่พบ library ในส่วนของ C++ พอดีหา solution การแก้ไขปัญหามาได้เลยเอามาโพสต์ให้ดูครับ
1. Download และติดตั้ง Windows 10 SDK
https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
2. จากนั้นเปิด Project ของเราใน Visual Studio 2017
3. กด Property ตรง C/C++->General->Additional include directories กำหนดเป็น
1 |
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt |
4. กลับมา compile ใหม่ใช้งานได้เลยครับ
Source:: StackOverFlow