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. Adding libraries in Qt with MSVC 2019 compiler
Forum Updated to NodeBB v4.3 + New Features

Adding libraries in Qt with MSVC 2019 compiler

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 269 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.
  • D Offline
    D Offline
    DubleDroxon442
    wrote on last edited by
    #1

    I'm currently working on setting up a Vectornav VN-200 using the programming library that they provide on their website. The file that I downloaded did not come with any .lib or .dll files to link to, but it came with all of the .cpp and .h files needed for the project. So I manually added them into a new widget project.

    However, when I attempt to build the files, I get these errors:

    serialport.obj:-1: error: LNK2019: unresolved external symbol __imp_RegEnumValueW referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl vn::xplat::SerialPort::getPortNames(void)" (?getPortNames@SerialPort@xplat@vn@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)

    serialport.obj:-1: error: LNK2019: unresolved external symbol __imp_RegOpenKeyExW referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl vn::xplat::SerialPort::getPortNames(void)" (?getPortNames@SerialPort@xplat@vn@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)

    serialport.obj:-1: error: LNK2019: unresolved external symbol __imp_RegQueryInfoKeyW referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl vn::xplat::SerialPort::getPortNames(void)" (?getPortNames@SerialPort@xplat@vn@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)

    I googled each of the functions, and they appear to come from a library in System32 called advapi32.dll, and I think the issue I'm having would be solved if I were able to get the compiler to include this library in my project. I found a guide to do it with a MinGW compiler on Qt 6, but I haven't found one on how to do it with the MSVC compiler that I have to use for this project. Any help would be appreciated.

    jsulmJ 1 Reply Last reply
    0
    • D DubleDroxon442

      I'm currently working on setting up a Vectornav VN-200 using the programming library that they provide on their website. The file that I downloaded did not come with any .lib or .dll files to link to, but it came with all of the .cpp and .h files needed for the project. So I manually added them into a new widget project.

      However, when I attempt to build the files, I get these errors:

      serialport.obj:-1: error: LNK2019: unresolved external symbol __imp_RegEnumValueW referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl vn::xplat::SerialPort::getPortNames(void)" (?getPortNames@SerialPort@xplat@vn@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)

      serialport.obj:-1: error: LNK2019: unresolved external symbol __imp_RegOpenKeyExW referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl vn::xplat::SerialPort::getPortNames(void)" (?getPortNames@SerialPort@xplat@vn@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)

      serialport.obj:-1: error: LNK2019: unresolved external symbol __imp_RegQueryInfoKeyW referenced in function "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl vn::xplat::SerialPort::getPortNames(void)" (?getPortNames@SerialPort@xplat@vn@@SA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)

      I googled each of the functions, and they appear to come from a library in System32 called advapi32.dll, and I think the issue I'm having would be solved if I were able to get the compiler to include this library in my project. I found a guide to do it with a MinGW compiler on Qt 6, but I haven't found one on how to do it with the MSVC compiler that I have to use for this project. Any help would be appreciated.

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

      @DubleDroxon442 Isn't this exact same question as in https://forum.qt.io/topic/133740/how-to-use-a-dll-on-qt-6-with-msvc-2019-64bit-compiler ?

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

      1 Reply Last reply
      1
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Dupe of https://forum.qt.io/topic/133740 - closed.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0

        • Login

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