When using eclipse CDT to develop C/C ++ projects, the GCC/g ++ header files and symbols on the fedora machine can be automatically disfound from the special version of Linux on the eclipse official website, however, I cannot use slackware. You need to manually add the standard library header file path/usr/include,/usr/local/include ......, However, this is also troublesome. You can check it today by setting c_include_path/cplus_include_path.
$ Echo "int main () {return 0;}"> a1.c
$ Gcc-V a1.c
......
# Include "..." search starts from here:
# Include <...> search starts from here:
/Usr/local/include
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/include
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/include-fixed
/Usr/include
The search list ends.
......
$ Echo "int main () {return 0;}"> a1.cpp
$ G ++-V a1.cpp
GGC criterion: -- Param GGC-Min-expand = 100 -- Param GGC-Min-heapsize = 131072
Ignore duplicate directories "/usr/lib64/QT/include"
Ignore the nonexistent directory "/usr/lib64/GCC/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/x86_64-slackware-linux/include"
# Include "..." search starts from here:
# Include <...> search starts from here:
/Usr/lib64/QT/include
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.5.2
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.5.2/x86_64-slackware-linux
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.5.2/backward
/Usr/local/include
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/include
/Usr/lib64/GCC/x86_64-slackware-linux/4.5.2/include-fixed
/Usr/include
The search list ends.
In eclipse, choose Window --> preferences --> C/C ++ --> build --> environment to add environment variables.
C_include_path =/usr/local/include:/usr/lib64/GCC/x86_64-slackware-linux/4.5.2/include:/usr/lib64/GCC/x86_64-slackware-linux/4.5.2/include-fixed: /usr/include
Cplus_include_path =/usr/lib64/QT/include:/usr/lib64/GCC/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.5.2:/usr/lib64/gcc/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.5.2/x86_64-slackware-linux:/usr/lib64/gcc/x86_64-slackware-linux/4.5.2/http://www.cnblogs.com/http://www.cnblogs.com/include/c++/4.5.2/backward:/usr/local/include:/usr/lib64/gcc/x86_64-slackware-linux/4.5.2/include:/usr/lib64/gcc/x86_64-slackware-linux/4.5.2/include-fixed:/usr/include
Remember to select the following append variables to native environment.
After the project is added, the header file of the standard library is normal.