[solved]Use x64 DLL
-
wrote on 7 Sept 2015, 12:11 last edited by
@catalin1122 said:
TestDllToQT.lib
It's impossible, you need to have your TestDllToQT.lib compile in the same architecture.
-
@catalin1122 said:
TestDllToQT.lib
It's impossible, you need to have your TestDllToQT.lib compile in the same architecture.
wrote on 7 Sept 2015, 12:57 last edited by@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. -
Use a 64bit Qt build
-
@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.wrote on 7 Sept 2015, 13:11 last edited by Franckynos 9 Jul 2015, 13:13@catalin1122
http://tver-soft.org/qt64Here 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/)
-
wrote on 7 Sept 2015, 16:29 last edited by catalin1122 9 Jul 2015, 16:30
-
wrote on 7 Sept 2015, 18:31 last edited by
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 -
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-dllexportwrote on 7 Sept 2015, 18:49 last edited by@belab
Hi,
I did that, except the partextern "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.
-
You just defined the export not import. Qt's Creating Shared Library documentation chapter explain how to do it properly
-
wrote on 7 Sept 2015, 19:49 last edited by
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...
-
wrote on 8 Sept 2015, 12:15 last edited by catalin1122 9 Aug 2015, 12:20
@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! :-)
13/13