Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [Solved] dll import problem
Forum Updated to NodeBB v4.3 + New Features

[Solved] dll import problem

Scheduled Pinned Locked Moved 3rd Party Software
8 Posts 3 Posters 9.1k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    JLamas
    wrote on 16 Oct 2012, 10:34 last edited by
    #1

    Hi.

    I'm trying to add a library to my project.
    In .pro I ve already add the library:
    @LIBS += -L$$PWD\libs\Vicon\ -lViconDataStreamSDK_CPP
    INCLUDEPATH += $$PWD\libs\Vicon\include@

    In .cpp already add the header file:
    @#include "Client.h"@

    This header has a lot of classes inside of a namespace which i called:
    @using namespace ViconDataStreamSDK::CPP;@

    Everything seems ok, I call the classes, but when debugging an error occur with dll import:

    engine.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: class ViconDataStreamSDK::CPP::Output_Connect __thiscall ViconDataStreamSDK::CPP::Client::Connect(class ViconDataStreamSDK::CPP::String const &)" (_imp?Connect@Client@CPP@ViconDataStreamSDK@@QAE?AVOutput_Connect@23@ABVString@23@@Z) referenced in function "public: void __thiscall Engine::ConnectVicon(void)" (?ConnectVicon@Engine@@QAEXXZ)

    engine.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ViconDataStreamSDK::CPP::Client::Client(void)" (_imp??0Client@CPP@ViconDataStreamSDK@@QAE@XZ) referenced in function "public: void __thiscall Engine::ConnectVicon(void)" (?ConnectVicon@Engine@@QAEXXZ)

    It seems is connected with this part of my header file Client.h:

    @#ifdef _EXPORTING
    #define CLASS_DECLSPEC __declspec(dllexport)
    #else
    #define CLASS_DECLSPEC __declspec(dllimport)
    #endif // _EXPORTING@

    And I have .dll and the .lib files inside the correct folders.....
    Any ideia whats going on?

    Thank you.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on 16 Oct 2012, 13:42 last edited by
      #2

      Are you sure the library is properly named? ViconDataStreamSDK_CPP.lib?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JLamas
        wrote on 16 Oct 2012, 13:57 last edited by
        #3

        Yes.... can deceive because the CPP but both of them are in the folder of debugging and in the folder of the .pro path

        ViconDataStreamSDK_CPP.dll
        and
        ViconDataStreamSDK_CPP -> Object File Library

        Could it be because they were made with Visual Studio C++ and Im using Qt IDE? Any conflict?

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rcari
          wrote on 16 Oct 2012, 16:19 last edited by
          #4

          Are you sure this lib and dll were built with Visual Studio? Not MinGW/Cygwin and therefore GCC as a compiler?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JLamas
            wrote on 16 Oct 2012, 17:29 last edited by
            #5

            Not sure, but in the Software Development Kit they just say this:

            Windows – C++
            Your application should
            #include “Client.h”
            Link against “ViconDataStreamSDK_CPP.lib”
            Redistribute:
            “ViconDataStreamSDK_CPP.dll”
            “Microsoft.VC8.CRT” (x86) or “Microsoft.VC9.CRT” (x64).

            And I've put both the dlls in the correct folders.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rcari
              wrote on 17 Oct 2012, 16:32 last edited by
              #6

              Well then you have a "mangling":http://en.wikipedia.org/wiki/Name_mangling problem: your DLL was built against an older version of Visual Studio which exported the symbols for C++ in a different way.
              You will only be able to link against that DLL with code compiled using:

              • Visual Studio 2005 aka VC80 for the 32 bits version

              • Visual Studio 2008 aka VC90 for the 64 bits version

              If you use a newer version of Visual Studio, then you will have to get newer versions of that library.
              Enjoy the joys of programming on the Windows platform :D

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JLamas
                wrote on 10 Dec 2012, 11:12 last edited by
                #7

                Problem was solved.

                With new dll, the problem was solved.

                Thank you all

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  marcanudo
                  wrote on 13 Dec 2012, 22:52 last edited by
                  #8

                  Have the same problem, sent you a pm JLamas.

                  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