Eclipse CDT standard library header file settings

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.