Linking MSVCRT with Qt5.3



  • Hello guys, I am trying to statically link library libmsvcrt.a in order to link the required _get_current_locale, which is an external library dependency.

    I've tried -lmsvcrt which does not seem to be working. Any idea how to link the needed function? I'm using Qt 5.3. with MinGW.


  • Moderators

    @Peppy Is libmsvcrt.a built with the same compiler?


  • Moderators

    @Peppy said:

    I've tried -lmsvcrt which does not seem to be working.

    i think i will never understand why so many people are expecting help in a forum but not saying what's actually not working... :)

    Whats the error, etc.?
    From where have you taken libmsvcrt.a?



  • The libmsvcrt.a is shipped with MinGW that is shipped with Qt 5.3
    What is not working: _get_current_locale is missing (undefined reference...)


  • Moderators

    @Peppy said:

    The libmsvcrt.a is shipped with MinGW that is shipped with Qt 5.3

    AFAIK this is not a static lib?!



  • It is not, hence I've assumed that if I do this

    #include <locale.h>
    //... 
    int main() {
      _locale_t t = _get_current_locale();
    }
    

    that it will work, because it's included in the header.


  • Moderators

    @Peppy
    only if the method's body is also in the header file of course.
    Otherwise it is missing and you get the error you already experienced.



  • @raven-worx @jsulm And therefore I am looking for the way how to mangle the VCRT library into my project, it's mandatory.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.