简体   繁体   中英

Why some IDEs (Eclipse, VS Code) need to add include paths while gcc manages to compile the same project?

Many of us have struggled with include path problems in their C/C++-IDEs like Eclipse or VS Code. The IDE underlines the #include-directives red and mentions it is unable to find the location of certain headerfiles. But in the same time the project compiles fine via gcc. It is understandable that both are two different steps and pieces of software but why is the gcc able to find the needed include paths while the IDE is not?

Run gcc -v -E - and you'll seen why. Each GCC installation has fixed include paths. GCC can't "find" these headers; GCC relies on being installed correctly.

Note that Visual Studio (the old, non-Code variant) rarely has this problem as it's much better integrated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM