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. [solved]Use x64 DLL
Forum Updated to NodeBB v4.3 + New Features

[solved]Use x64 DLL

Scheduled Pinned Locked Moved General and Desktop
x64 dll64bit
13 Posts 5 Posters 5.8k Views 2 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.
  • SGaistS SGaist

    Hi,

    Are you trying to link your 64bit DLL with a 32bit Qt build ?

    C Offline
    C Offline
    catalin1122
    wrote on last edited by
    #3

    @SGaist
    Yes.

    1 Reply Last reply
    0
    • FranckynosF Offline
      FranckynosF Offline
      Franckynos
      wrote on last edited by
      #4

      @catalin1122 said:

      TestDllToQT.lib

      It's impossible, you need to have your TestDllToQT.lib compile in the same architecture.

      C 1 Reply Last reply
      0
      • FranckynosF Franckynos

        @catalin1122 said:

        TestDllToQT.lib

        It's impossible, you need to have your TestDllToQT.lib compile in the same architecture.

        C Offline
        C Offline
        catalin1122
        wrote on last edited by
        #5

        @Franckynos
        Is there a way to make my Qt project x64 and compatible with the dll? I could compile the dll in x32 but I would prefer not to.

        FranckynosF 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #6

          Use a 64bit Qt build

          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
          • C catalin1122

            @Franckynos
            Is there a way to make my Qt project x64 and compatible with the dll? I could compile the dll in x32 but I would prefer not to.

            FranckynosF Offline
            FranckynosF Offline
            Franckynos
            wrote on last edited by Franckynos
            #7

            @catalin1122
            http://tver-soft.org/qt64

            Here there was pre-build qt x 64 but the server not respond. :(
            You need to find (or compile) qt in 64 bits

            (http://sourceforge.net/projects/qt64ng/files/qt/x86-64/5.4.2/mingw-5.1/seh/)

            1 Reply Last reply
            1
            • C Offline
              C Offline
              catalin1122
              wrote on last edited by catalin1122
              #8

              I've downloaded msvc2012 from here and Qt Creator 3.5.0 x64 from here. I have installed them and changed the kit and compiler but i still get those errors.

              Any ideas?

              1 Reply Last reply
              0
              • B Offline
                B Offline
                belab
                wrote on last edited by
                #9

                Hi catalin1122,
                when linking against your dll you have to import the symbols, when creating the dll the symbols have to be exported this is usually done with some macros like in the following link - http://stackoverflow.com/questions/538134/exporting-functions-from-a-dll-with-dllexport

                C 1 Reply Last reply
                1
                • B belab

                  Hi catalin1122,
                  when linking against your dll you have to import the symbols, when creating the dll the symbols have to be exported this is usually done with some macros like in the following link - http://stackoverflow.com/questions/538134/exporting-functions-from-a-dll-with-dllexport

                  C Offline
                  C Offline
                  catalin1122
                  wrote on last edited by
                  #10

                  @belab
                  Hi,
                  I did that, except the part extern "C".

                  When I import the DLL how do I do it in Qt? Now I do it statically (in *.pro) and I get those errors. The thing is that when I compile the DLL on x32 it works the way I do it. But not in x64.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    You just defined the export not import. Qt's Creating Shared Library documentation chapter explain how to do it properly

                    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
                    1
                    • hskoglundH Online
                      hskoglundH Online
                      hskoglund
                      wrote on last edited by
                      #12

                      Hi, SGaist is correct, just want to add, to see an example how to use Q_DECL_EXPORT and Q_DECL_IMPORT, you can create a test project in Qt Creator: New File or Project, Library, C++ Library. Look in the xxx_global.h file created...

                      1 Reply Last reply
                      1
                      • C Offline
                        C Offline
                        catalin1122
                        wrote on last edited by catalin1122
                        #13

                        @SGaist @hskoglund @belab @Franckynos
                        Thank you for helping me!

                        You were right, I did not import the symbols.

                        I added this :

                        #ifdef GAME_EXPORTS
                        #    define  GAME_API __declspec(dllexport)
                        #else
                        #    define  GAME_API __declspec(dllimport)
                        #endif
                        

                        to my DLL code and now everything works.

                        Have a nice day, you rock! :-)

                        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