# Qualcomm Hexagon C++ Library Supplement This section describes how to select the C++ library to use of the two that are provided with the Hexagon Tools and the reasons for selecting one library over the other. ## Usage Details The C++ libraries are distributed with the Hexagon Tools for use in writing C++ programs. The libraries are used to support C++ language features. They also include the containers, file I/O, strings, exceptions, smart pointers, and other features described by the C++ standard. Two different libraries are distributed with the Hexagon Tools: libstdc++ and libc++. ### Using the C++ library By default, hexagon-clang++ uses the C++03 standard and selects the libstdc++ library for compilation and linkage. If the more recent standards are specified, such as C++11 (std=c++11), C++14 (std=c++14), etc., hexagon-clang++ will select the libc++ library for compilation and linkage. You can use the stdlib=libc++ or stdlib=libstdc++ arguments with hexagon-clang++ to select the appropriate standard library. ### Differences between libstdc++ and libc++ libstdc++ is the “historical” C++ library, and it supports only C++98 and C++03 language modes. It can be used with standalone mode to write and debug C++ programs. This standalone mode is often used in conjunction with the Hexagon simulator. See *Hexagon Stand-alone Application User Guide* (80-N2040-22). libc++ was introduced to support C++11 and beyond. libc++ requires support in the form of OS include paths for headers and libraries. This means that many programs built with libc++ won’t successfully compile without explicit -I/path/to/os/include arguments, and they won’t link without explicit arguments for the linker as well. The libc++ standard library is distributed as two distinct libraries, libc++ and libc++abi. When -stdlib=libc++ is used, the compiler/linker is configured to resolve to each of those respective includes/libraries. If you use the -nostdlib argument to disable the automatic inclusion of libc++, you should know that the C++ code will require linkage with both libc++ and libc++abi. ### Compiling with C++11 When compiling source files in C++11 mode, you must use libc++. You must also provide the necessary include paths to find the QuRT headers. For example: hexagon-clang++ -std=c++11 -I/path/to/qurt/install/variant/include/qube -I/path/to/qurt/install/variant/include/posix -I/path/to/qurt/install/variant/include/qurt -c -o new_program.o new_program.cpp Copy to clipboard ### System configuration limitations #### Simulator Some library features include time/date referenced by the epoch (“wall clock”) and interval times that can be used in delays (for example, `std::this_thread::sleep`) or time- bounded waits (try\_lock\_for(), wait\_for(), etc.). In a normal system, these are often driven by a timer tick interrupt that elapses at a specified interval. When using hexagon-sim with QuRT, these features depend on co-simulators (“cosims”) used to model this external device. The qtimer cosim may be necessary to simulate a real hHexagon processor. See the section on cosimulation in *Hexagon Simulator System API User Guide* (80-N2040-18) for details. See the qtimer cosim example included with the Hexagon tools for an example of using the qtimer cosim. This example is found in *<Hexagon\_tools>/Examples/cosims/qtimer\_test*. #### Target Note that QuRT won’t provide a real UTC reference, so wall clock times won’t match other processors in the SoC or in the outside world. Last Published: Oct 06, 2026 [Previous Topic Qualcomm Hexagon C++ Library Supplement](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/index_80-n2040-43_cpp_supplement.md) [Next Topic Picolibc User Guide](https://docs.qualcomm.com/bundle/publicresource/80-N3040-23/topics/index_80-n2040-103_picolibc_user_guide.md)