Given that the interface is declared ' extern "C" ' and the functions are not __stdcall there should not be any name mangling issues and no need for the reimp/dlltool stuff.
I don't know what "qtAddLibrary()" is: cannot find it in my docs. Your PRO file should look like this:
LIBS += -L$$quote($$PWD/lib) -lftd2xx
LIBS += -L$$quote($$PWD/lib) -lftd2xx
To copy to clipboard, switch view to plain text mode
and you do not need either the .def file or the resulting .a file. With just ftd2xx.dll and ftd2xx.lib in the lib directory this works just fine:
Y:\testeusb>dir /b lib
ftd2xx.dll
ftd2xx.lib
Y:\testeusb>qmake "CONFIG+=release"
Y:\testeusb>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `Y:/testeusb'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.02.1\qt\i
nclude\QtCore" -I"c:\Qt\2010.02.1\qt\include" -I"c:\Qt\2010.02.1\qt\include\Acti
veQt" -I"release" -I"c:\Qt\2010.02.1\qt\mkspecs\win32-g++" -o release\main.o mai
n.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o release\testeusb.exe release/m
ain.o -L"c:\Qt\2010.02.1\qt\lib" -LY:/testeusb/lib -lftd2xx -lQtCore4
mingw32-make[1]: Leaving directory `Y:/testeusb'
Y:\testeusb>dir /b release
main.o
testeusb.exe
Y:\testeusb>dir /b lib
ftd2xx.dll
ftd2xx.lib
Y:\testeusb>qmake "CONFIG+=release"
Y:\testeusb>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `Y:/testeusb'
g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2010.02.1\qt\i
nclude\QtCore" -I"c:\Qt\2010.02.1\qt\include" -I"c:\Qt\2010.02.1\qt\include\Acti
veQt" -I"release" -I"c:\Qt\2010.02.1\qt\mkspecs\win32-g++" -o release\main.o mai
n.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -Wl,-subsystem,console -mthreads -Wl -o release\testeusb.exe release/m
ain.o -L"c:\Qt\2010.02.1\qt\lib" -LY:/testeusb/lib -lftd2xx -lQtCore4
mingw32-make[1]: Leaving directory `Y:/testeusb'
Y:\testeusb>dir /b release
main.o
testeusb.exe
To copy to clipboard, switch view to plain text mode
Bookmarks