Well... Bummer. In the latest version of the Toto test project, i was actually
using __stdcall. But still...
This is from TotoLib.h:
#ifndef TotoLib_h
#define TotoLib_h
#include "TotoLib_Global.h"
class TotoLibOpt TotoLib {
public:
/**/ TotoLibOpt __stdcall TotoLib ();
};
#endif
This is from TotoLib.cpp:
#include "TotoLib.h"
#include <QtCore/QDebug>
__stdcall TotoLib::TotoLib() {
qDebug() << "It worked!";
}
TotoLib_Global.h looks like this (TotoLibExport is only defined when compiling
the lib):
#ifndef TotoLib_Global_h
#define TotoLib_Global_h
#if defined(TotoLibExport)
# define TotoLibOpt __declspec(dllexport)
#else
# define TotoLibOpt __declspec(dllimport)
#endif
#endif
After compiling, gendef extracts this (I think the result is the same with /
without --assume-stdfcall):
; Definition file of TotoLib.dll
; Automatic generated by gendef
; written by Kai Tietz 2008
LIBRARY "TotoLib.dll"
EXPORTS
_ZN7TotoLibC1Ev@4@4
_ZN7TotoLibC2Ev@4@4
Then, i create the delay import library with:
dlltool --dllname TotoLib.dll --input-def TotoLib.def --output-delaylib
libTotoLib.delayed.a TotoLib.dll
And i create a simple program which instanciates a TotoLib object from the
library:
#include <../TotoLib/TotoLib.h>
int main (int argc, char *argv[]) {
TotoLib t;
}
It won't link!!
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
-DQT_DLL -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE
-DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
-I"c:\QtSdk\Desktop\Qt\4.8.1\mingw-w64\include\QtCore"
-I"c:\QtSdk\Desktop\Qt\4.8.1\mingw-w64\include" -I"..\TotoLib\include"
-I"c:\QtSdk\Desktop\Qt\4.8.1\mingw-w64\include\ActiveQt" -I"debug"
-I"..\..\..\Documents\Test\TotoApp" -I"."
-I"c:\QtSdk\Desktop\Qt\4.8.1\mingw-w64\mkspecs\win32-g++" -o debug\main.o
..\..\..\Documents\Test\TotoApp\main.cpp
g++ -Wl,-subsystem,console -mthreads -o
..\..\..\Documents\Test\Debug\TotoApp.exe debug/main.o
-L"c:\QtSdk\Desktop\Qt\4.8.1\mingw-w64\lib"
-LC:/Home/Administrator/Documents/Test/Debug -lTotoLib.delayed -lQtCored4
mingw32-make.exe[1]: Leaving directory
`C:/Home/Administrator/Desktop/Debug/TotoApp'
debug/main.o: In function `main':
C:\Home\Administrator\Desktop\Debug\TotoApp/../../../Documents/Test/TotoApp/main.cpp:6:
undefined reference to `_imp___ZN7TotoLibC1Ev@4'
Am i missing something? i feel like i have done exactly what you are telling me
to try, no?
Thanks,
Pierre.
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public