From: Mikko Rasa Date: Fri, 16 Sep 2016 22:32:45 +0000 (+0300) Subject: Explicitly add -lmingw32 before any other libraries X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=36f162eedf3772d2c0373651795e7e38b6d28fb4;p=builder.git Explicitly add -lmingw32 before any other libraries This fixes linking when WinMain() is in a library (such as libmspcore) and shouldn't be harmful when it isn't. --- diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 75a1bac..1b969b4 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -228,6 +228,9 @@ Task *GnuLinker::Linker::run(const Target &target) const bool static_link_ok = (binfo.libmode<=BuildInfo::STATIC); + if(architecture->get_system()=="windows" && architecture->get_cross_prefix().find("mingw")!=string::npos) + argv.push_back("-lmingw32"); + const Target::Dependencies &depends = target.get_dependencies(); for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) {