GCC Environment Variables & Eclipse CDT header file configuration

Source: Internet
Author: User

ext.: http://blog.csdn.net/statdm/article/details/7751000GCC Environment Variables & Eclipse CDT header file Configuration

The default is to use the system's header file path if you are using Eclipse for C/S development under UNIX, if you have a new compiler installed yourself, such as the latest version of GCC 4.7.1, this time you want to have the header file

The path points to your GCC installation path, configured as:

Menu Window-->preferences

Add Variable Cpp_include_path

After rebooting, the C + + header file in include points to the path of the new setting

GCC variables

There are a number of environment variables that can be set to affect how GCC compiles the program. The control of these variables can also be used with the appropriate command-line options.

Some environment variables are set in the list of directory names. These names are used in the same format as the PATH environment variable. The special character path_separator (defined when the compiler is installed) is used between directory names. In UNIX systems, delimiters are colons, while Windows systems are semicolons.

C_include_path

Use this environment variable when compiling a C program. This environment variable specifies one or more list of directory names, looking for header files as if the-isystem option was specified on the command line. All directories specified by-isystem are looked up first.

See also CPath, Cplus_include_path and Objc_include_path.

Compiler_path

The environment variable specifies one or more list of directory names, and if you do not specify a Gcc_exec_prefix locator subroutine, the compiler will look for its subroutines here.

See also Library_path, Gcc_exec_prefix, and-B command-line options.

CPath

Use this environment variable when compiling C, C + +, and objective-c programs. This environment variable specifies one or more list of directory names, looking for header files as if specifying the-l option on the command line. All directories specified by-L are first found.

See also C_include_path, Cplus_include_path and Objc_include_path.

Cplus_include_path

Use this environment variable when compiling a C + + program. This environment variable specifies one or more list of directory names, looking for header files as if the-isystem option was specified on the command line. All directories specified by-isystem are looked up first.

See also CPath, C_include_path and Objc_include_path.

Dependencies_output

Setting the environment variable for the file name causes the preprocessor to write the makefile rule based on the dependency relationship to the file. The system header file name is not included.

If the environment variable is set to sole name, it is considered a file name, and the name of the dependency rule comes from the source file name. If there are two names in the definition, the second name is the target name to use as the dependency rule.

The result of setting this environment variable is the same as the combination of-mm,-MF, and-MT using command-line options. See also Sunpro_dependencies.

Gcc_exec_prefix

If the environment variable is defined, it is prefixed with all subroutine names that the compiler executes. For example, if you set a variable to Testver instead of find as, the assembler first looks under the name Testveras. If it is not found here, the compiler will continue to look for its normal name. You can use a slash in the prefix name to indicate the path name.

The default setting for Gcc_exec_prefix is PREFIX /lib/gcc-lib/, where PREFIX is the name specified by the Configure script when the compiler is installed. The prefix is also used to locate standard connector files, which are included as part of the executable program.

If you use the-B command-line option, this setting is overridden. See also Compiler_path.

Lang

This environment variable is used to indicate the character set used by the compiler to create wide-character text, string literals, and annotations.

Defines LANG as C-jis, which indicates that the preprocessor interprets multibyte characters according to JIS (Japanese industry standard) characters. C-sjis can be used to indicate shift-jis characters and c-eucjp to indicate Japanese EUC.

If LANG is not defined, or is defined as not recognized, the function Mblen () is used to determine the character width, and MBTOWC () is used to convert multibyte sequences to wide characters.

Lc_all

If set, the value of the environment variable overrides all settings for Lc_messages and Lc_ctype.

Lc_ctype

The environment variable indicates the character classification of multibyte characters defined in the reference string. Primarily used to determine the character boundaries of a string, character encodings need to be quoted or escaped characters, which can be incorrectly interpreted as the end of a string or a special string. For Australian 中文版, you can set it to En_au, and to Mexican Spanish, you can set it to es_mx. If the variable is not set, the default is the value of the lang variable, or if Lang is not set, then the C English behavior is used. See also Lc_all.

Lc_messages

The environment variable indicates which language the compiler uses to emit diagnostic messages. For Australian 中文版, can be set to En_au, Mexican Spanish, can be set to ES_MX. If the variable is not set, the default value of the lang variable is used, or if Lang is not set, then the C English behavior is used. See also Lc_all.

Ld_library_path

The environment variable will not affect the compiler, but it will have an impact when the program runs. variable specifies a list of directories that the program will look for to locate the shared library. The executor must set the variable only if the shared library is not found in the directory of the compiled program.

Ld_run_path

The environment variable will not affect the compiler, but it will have an impact when the program runs. The variable indicates the name of the file at run time, and the running program can then get its symbolic name and address. The address is not re-loaded, so the symbol may refer to an absolute address in another file. This is exactly the same as the LD tool using the-r option.

Library_path

The environment variable can be set to one or more directory name lists, and the connector will search for the directory to find special connector files, and a library with the name specified by the-L (letter L ) command-line option.

The directory specified by the-l command-line option precedes the environment variable and is first looked up. See also Compiler_path.

Objc_include_path

Use this environment variable when compiling the OBJECTIVE-C program. The list of one or more directory names is specified by an environment variable, which is used to find the header file as if the-isystem option was specified on the command line. All directories specified by the-isystem option are first looked up.

See also CPath, Cplus_include_path and C_include_path.

Sunpro_output

Setting the environment variable for the file name causes the preprocessor to write the makefile rule based on the dependency relationship to the file. Will contain the system header file name.

If the environment variable is set to a single name, it will be treated as a file name, and the name in the dependency rule will be obtained from the name of the source file. If there are two names in the definition, the second name is the target name in the dependency rule.

The result of setting this environment variable is the same as using the parameters-M,-MF, and-MT on the command line. See Dependencies_output.

TMPDIR

This variable contains the path name of the directory where the program compiles the temporary working files. These files are usually deleted at the end of the compilation process. An example of such a file is a file that is output by the preprocessor and entered to the compiler.

GCC Environment Variables & Eclipse CDT header file configuration

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.