Linux eclipse unresolved injection sion

Source: Internet
Author: User

Another problem encountered today is that the same error occurs in include <sys/types. h>.

Solution: copy the Sys folder to the/usr/include folder. The problem is solved.

--------------------------------------------- Split line --------------------------------

I just got started with Linux and used ubuntu11.10 to programming with IDE. Eclipse CDT is powerful. After installation, C ++ can be compiled and run.ProgramBut there is a problem, that is, the header file of the C ++ standard library cannot be found, and files such as <iostream> cannot be opened. The compiler warning is as follows:

Display

Unresolved regression sion: <iostream>

Although compilation is not affected, the symbols in the header file cannot be located. The reason is that the C and C ++ directories of eclipse are not specified. You can specify the header file directory by setting the c_include_path and cpp_include_path environment variables in eclipse.

Add these two variables to WINDOW> preferences> C/C ++> environment:

Set c_include_path to/usr/include

Set cpp_include_path to/usr/include/C ++/4.6.1

4.6.1 is the GCC version, which can be obtained using gcc -- version. You can change it to the corresponding version.

After these two variables are added, eclipse can normally identify the header files of the C ++ standard library. Eclipse adds all the nodes files to the project.

I just got started with Linux and used ubuntu11.10 to programming with IDE. Eclipse CDT is very powerful. Although the C ++ program can be compiled and run after installation, the header file of the C ++ standard library cannot be found, files such as <iostream> cannot be opened. The Compiler provides the following warning:

Display

Unresolved regression sion: <iostream>

Although compilation is not affected, the symbols in the header file cannot be located. The reason is that the C and C ++ directories of eclipse are not specified. You can specify the header file directory by setting the c_include_path and cpp_include_path environment variables in eclipse.

Add these two variables to WINDOW> preferences> C/C ++> environment:

Set c_include_path to/usr/include

Set cpp_include_path to/usr/include/C ++/4.6.1

4.6.1 is the GCC version, which can be obtained using gcc -- version. You can change it to the corresponding version.

After these two variables are added, eclipse can normally identify the header files of the C ++ standard library. Eclipse adds all the nodes files to the project.

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.