Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

g++: error: unrecognized command line option '-mt'

I'm trying to compile a program from source. In an OpenSuse 12.1 chroot the program compiles fines, but in an OpenSuse leap 42.1 chroot I get the following error:

g++: error: unrecognized command line option '-mt'

I've searched (both on here and on google) but couldn't find much information on the -mt flag. What is this '-mt' flag?

like image 831
pydumm Avatar asked Nov 22 '25 10:11

pydumm


1 Answers

This flag is used to compile and link multi-threaded applications.

With gcc you should use -pthread for both compiling and linking, no -lpthread is necessary.

When compiling -pthread sets the necessary macros, when linking it links in the required libraries.

like image 67
Maxim Egorushkin Avatar answered Nov 23 '25 23:11

Maxim Egorushkin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!