g++, gcc
Compile and link a program (GNU)
Note:
Syntax:
gcc_variant [ option | filename ]...
g++_variant [ option | filename ]...
where gcc_variant and g++_variant depend on the target platform, as follows:
| Target platform | gcc_variant | g++_variant |
|---|---|---|
| ARMv7 | ntoarmv7-gcc | ntoarmv7-g++ |
| AArch64 | ntoaarch64-gcc | ntoaarch64-g++ |
| x86 64-bit | ntox86_64-gcc | ntox86_64-g++ |
Runs on:
Linux, Mac, Microsoft Windows
Description:
QNX recommends that you use qcc or q++ instead of gcc or g++ to compile and link your programs.
You can use qcc or q++ with the -V option to invoke the C (qcc) or C+ (q++) compiler. For example, the following command compiles a C program for an AArch64 target:
qcc -Vgcc_ntoaarch64le my_file.c
The following command compiles a C++ program for an AArch64 target using the preferred, LLVM-based libc++ library:
q++ -Vgcc_ntoaarch64le my_file.cc
You can modify the command options to compile using the GNU-based libstdc++ library:
q++ -Vgcc_ntoaarch64le_gpp my_file.cc
For detailed documentation about gcc, go to https://gcc.gnu.org/onlinedocs/.
Note:
- If you use exceptions, you must link with the -lang-c++ option to qcc. This option is the default for q++.
- Even with exceptions disabled, the default new() operator throws a
std::out_of_memoryexception if there isn't enough memory. If you want new() to return NULL instead of throwing an exception, you can provide a custom new handler via std::set_new_handler() to do so, or usestd::nothrow.
Contributing author:
GNU
Page updated:
