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. __stdcall and external library
Forum Update on Monday, May 27th 2025

__stdcall and external library

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 3.8k 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.
  • L Offline
    L Offline
    Lorenz1995
    wrote on 19 Feb 2014, 09:01 last edited by
    #1

    Hi guys, i have a problem with QT 5.
    I have a DLL and an LIB file that i have included into my project file.
    When i build all project and files i have an error: "undefined reference to...." but i have included all libraries correctly.
    All functions that i have called into my program are declared with __stdcall into the .H file, i think that this is the problem!
    Someone can help me?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Feb 2014, 21:52 last edited by
      #2

      Hi and welcome to devnet,

      Are you sure you implemented all the functions in your dll ? Are they exported correctly ?

      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
      0
      • L Offline
        L Offline
        Lorenz1995
        wrote on 20 Feb 2014, 07:19 last edited by
        #3

        It isn't my library, i have only received the files from a customer. In the .h file there are:

        ".H File":http://s28.postimg.org/d4uvmb88d/Immagine.png

        and this is my .pro file:

        ".Pro File":http://s27.postimg.org/l5q67n3vn/Immagine.png

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jeroentjehome
          wrote on 20 Feb 2014, 08:22 last edited by
          #4

          Hi,
          What compiler did your supplier used? Different types of compilers use different namemangling options, thus Qt (MinGw) will not find any links to libraries if they are compiled with e.g. MSVC2010.
          Better to get a .dll and use QLibrary, or ask the supplier for a library compiled with the same compiler (also type!) as you want to use.

          Greetz, Jeroen

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Lorenz1995
            wrote on 20 Feb 2014, 08:32 last edited by
            #5

            Mhh you're right, i'm using the Qt Compiler! Is there a way to include the MSVC2010 compiler?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 20 Feb 2014, 09:11 last edited by
              #6

              There's no Qt compiler, you are either using MinGW or Visual Studio. Which package did you install ?

              Visual Studio is available on Microsoft's web site

              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
              0
              • L Offline
                L Offline
                Lorenz1995
                wrote on 20 Feb 2014, 09:19 last edited by
                #7

                I'm using MinGW, but i have to create a program with this library on Qt. Is there a way to use it? Or i have to change the compiler?

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  Jeroentjehome
                  wrote on 20 Feb 2014, 10:51 last edited by
                  #8

                  Hi,
                  There is also a Qt package compiled with the MSVC2010 compiler. If your library is compiled with that compiler, install VisualStudio Express 2010, install Qt with the MSVC2010 package, install the Microsoft debugger kit so Qt can debug with that compiler. Then you should have a program that compiles.

                  Greetz, Jeroen

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jeroentjehome
                    wrote on 20 Feb 2014, 10:52 last edited by
                    #9

                    Or ask the supplier to compile the library with the MinGw compiler

                    Greetz, Jeroen

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      Lorenz1995
                      wrote on 20 Feb 2014, 10:56 last edited by
                      #10

                      Ok, but i have already tried to install this plugin for VS 2010...but it doesnt' work because when i try to load a Qt project on VS i have an error: "qmake.exe not found", something like that...

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        Jeroentjehome
                        wrote on 20 Feb 2014, 11:19 last edited by
                        #11

                        hi, you do not need to load your project in VS!
                        With the install of VS you also get the compiler. That's why you need to install that, you do not use it.
                        You open QtCreator and setup your program to use the MSVC2010 compiler and setup the debugger (both should be found automatic, sometimes a restart is needed).
                        Then create your program in Qt!!
                        Or otherwise you need to setup a custom made program file in VS to include Qmake.exe etc etc.

                        Greetz, Jeroen

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 20 Feb 2014, 12:18 last edited by
                          #12

                          Also, don't forget to install Qt built with Visual Studio 2010 (or build it 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
                          0

                          1/12

                          19 Feb 2014, 09:01

                          • Login

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