Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Integration generated library from Visual Studio

    General and Desktop
    3
    4
    653
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      Xav12358 last edited by

      Hello,

      I generate a exe file in Visual Studio and it also generates the lib file.

      I want to use that lib file into QtCreator . So I made that pro file :

      ######### LIBRARY
      
      LIBS += -LC:\Users\seniordev\Desktop\Developpement\bin\win64\Release\ -lMyLib
      
      INCLUDEPATH += $$PWD/../../BGE
      DEPENDPATH += $$PWD/../../BGE
      
      PRE_TARGETDEPS += C:\Users\seniordev\Desktop\Developpement\bin\win64\Release\MyLib.lib
      
      

      But I get that error , it seems the library is not detected:

      main.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl Parametermanager::~Parametermanager(void)" (??1Parametermanager@@QEAA@XZ) referenced in function main
      

      The ParameterManager is a object of MyLib.lib.

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @Xav12358 last edited by

        @Xav12358 Do you use the same compiler in QtCreator as you used to create the library?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 1
        • X
          Xav12358 last edited by Xav12358

          I made a mistake during my library generation. Now I get that in QTCreator:

          error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj
          
          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Hi,

            That means that you are trying to link a library built with the static VS runtime with one using the dynamic runtime. You should ensure all your libraries link to the same runtime. In this case the dynamic runtime otherwise you'll have to rebuild Qt yourself.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply Reply Quote 3
            • First post
              Last post