Add -lrt
to the end of g++ command line. This links in the librt.so “Real Time” shared library.
More Related Contents:
- VS Code will not build c++ programs with multiple .ccp source files
- Compiling multithread code with g++
- Linux: Executing child process with piped stdin/stdout
- Why does the library linker flag sometimes have to go at the end using GCC?
- C and C++ programming on Ubuntu 11.10 [closed]
- Is there an equivalent to WinAPI’s MAX_PATH under linux/unix?
- Find available network interfaces in C/C++? [closed]
- How to get the username in C/C++ in Linux?
- some problems about c++ try catch [closed]
- How do I make this Linux program compile? [closed]
- How do I find the location of the executable in C? [duplicate]
- How to properly add include directories with CMake
- print call stack in C or C++
- C++ Dynamic Shared Library on Linux
- How to get memory usage at runtime using C++?
- How can I create directory tree in C++/Linux?
- C++ cross-compiler from Windows to Linux [closed]
- Seeking and reading large files in a Linux C++ application
- How to disassemble a binary executable in Linux to get the assembly code?
- Cancelling a thread using pthread_cancel : good practice or bad
- Linking libstdc++ statically: any gotchas?
- How to set up googleTest as a shared library on Linux
- Cross Platform Floating Point Consistency
- “relocation R_X86_64_32S against ” linking Error
- OpenCV on ubuntu 11.10
- How much overhead is there when creating a thread?
- Default libraries linked in by gcc?
- Undefined reference to process(std::__cxx11::basic_string … ) when compiling affdex linux sample applications
- Why do I see 400x outlier timings when calling clock_gettime repeatedly?
- Linux C++: how to profile time wasted due to cache misses?