Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Integration generated library from Visual Studio

Integration generated library from Visual Studio

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 867 Views
  • 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 Offline
    X Offline
    Xav12358
    wrote on last edited by
    #1

    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.

    jsulmJ 1 Reply Last reply
    0
    • X Xav12358

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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
      1
      • X Offline
        X Offline
        Xav12358
        wrote on last edited by Xav12358
        #3

        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
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved