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

[solved]Use x64 DLL

Scheduled Pinned Locked Moved General and Desktop
x64 dll64bit
13 Posts 5 Posters 5.4k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 7 Sept 2015, 12:02 last edited by
    #2

    Hi,

    Are you trying to link your 64bit DLL with a 32bit 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

    C 1 Reply Last reply 7 Sept 2015, 12:09
    0
    • S SGaist
      7 Sept 2015, 12:02

      Hi,

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

      C Offline
      C Offline
      catalin1122
      wrote on 7 Sept 2015, 12:09 last edited by
      #3

      @SGaist
      Yes.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Franckynos
        wrote on 7 Sept 2015, 12:11 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 7 Sept 2015, 12:57
        0
        • F Franckynos
          7 Sept 2015, 12:11

          @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 7 Sept 2015, 12:57 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.

          F 1 Reply Last reply 7 Sept 2015, 13:11
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 7 Sept 2015, 12:58 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
              7 Sept 2015, 12:57

              @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.

              F Offline
              F Offline
              Franckynos
              wrote on 7 Sept 2015, 13:11 last edited by Franckynos 9 Jul 2015, 13:13
              #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 7 Sept 2015, 16:29 last edited by catalin1122 9 Jul 2015, 16:30
                #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 7 Sept 2015, 18:31 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 7 Sept 2015, 18:49
                  1
                  • B belab
                    7 Sept 2015, 18:31

                    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 7 Sept 2015, 18:49 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
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 7 Sept 2015, 19:39 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
                      • H Offline
                        H Offline
                        hskoglund
                        wrote on 7 Sept 2015, 19:49 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 8 Sept 2015, 12:15 last edited by catalin1122 9 Aug 2015, 12:20
                          #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

                          11/13

                          7 Sept 2015, 19:39

                          • Login

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