I want to compile a C++ program that includes & uses the mutex library, with G++ via the Command Prompt on a Windows system. I'm attempting to compile with C++ 17.
My version of G++ is g++
(MinGW.org GCC-6.3.0-1) 6.3.0
I'm normally able to compile simple programs via the
command on any Command Prompt. However, attempting to compile the following example file
std::cout << "test\n";
With the following command:
g++ -std=c++17 test.cpp -o test
test.cpp:4:6: error: 'mutex' in namespace 'std' does not name a type
My understanding of this is what I need to supply a flag for the linker to link the library when issuing a build command with G++, however I'm not quite sure what that flag is for
and where to place it in the build command.
What is the linker flag required to supply to G++ to compile a C++ file that includes
Thanks for reading my post, any guidance is appreciated.