|
From: MARTIN P. <hic...@gm...> - 2012-05-12 13:26:58
|
> Hmm, I doubt that the code for delay-load support makes a difference > of calling-convention of exports. Only important thing is that those > function are declared with proper calling-convention prototype. That's exactly what JonY told me when we attacked this problem (He was of a great help regarding this matter, just a side note :) ). > The only issue I might see here is that your DLL tries to export a > variable. This doesn't work with binutils and delayed-load code. Then should i assume a static a variable is, and the library code contains a lot of those (No global, but class-wide static, but they are the same right?). None of them can be accessed from outside the library, because these are having static accessors as well in the classes (Think about them as singletons). Can it be problematic? The thing is, i have made a very small test project without any global variable nor static, and i was able to generate the import lib with gendef / dlltool as long as it wasn't delay-loaded. The delay-loaded version was either unable to link in some cases, or was crashing at run-time. Would you also like me to post a minimal test project? > Could you provide the generated .def file for having a look? Sure. It is attached to this email (The file being the output of the gendef - $DLL > $DEF script command). Note: The calling binary is crashing even before doing anything related to this DLL. If i set a breakpoint in the first line in my main(), it crashes when stepping into it (And the first line isn't related to SCLibrary, it's the usual Qt QApplication constructor which works if i link to the default generated libSCLibrary.a). i have a subsidiary question: in my very specific case, since i have access to my library source code, i also have the "default" generated import lib which goes along with the DLL. Wouldn't it be simpler if dlltool could use this import .a file (Which contains everything needed, right?) instead of making a cheesy (At least it appears to me to be a very erroneous step) .def file in the midle, containing something already present and well-organized in the default .a ? Something like "dlltool --input-import-lib libSCLibrary.a --output-delayed-import-lib libSCLibrary.delayed.dll.a" ? Thanks Kai :) Pierre. |