# stdlib

Lets you select the C++ library to be used for linking.

## Syntax

Linux: | None

macOS: | -stdlib[=keyword]

Windows: | None

## Arguments

keyword | Is the function information to include. Possible values are:
libc++ | Links using the libc++ library.
libstdc++ | Links using the GNU libstdc++ library.

## Default

-stdlib=libc++ | The compiler links using the libc++ library.

## Description

This option lets you select the C++ library to be used for linking. This option is processed by the command that initiates linking, adding library names explicitly to the link command.

Currently, if you do not specify this option, the libc++ headers and library are used.

### Note

The IDE provides another possible setting for option -stdlib, which lets you choose the compiler default rather than a specific library.

## IDE Equivalent

Visual Studio: None

Eclipse: None

Xcode: Language > C++ standard library > libstdc++

Language > C++ standard library > libc++

Language > C++ standard library > compiler-default

## Alternate Options

None

Parent topic: Compatibility Options