From: Nathan R. <zer...@ho...> - 2013-09-14 07:59:09
|
> It appears the problem has nothing to do with wxWidgets. Even the > following program: > > #include <windows.h> > > int main() > { > OpenPrinter(0, 0, 0); > } > > gives the same error on startup after being compiled with > > g++ test.cpp -lwinspool > > So the problem is definitely with MinGW and/or my system. > > Earnie, is there anything I can do to further diagnose > this problem? Modifying libwinspool.def and rebuilding > libwinspool.a the way you suggested was ineffective. I investigated this a little. Recall that the unmodified w32api source started with: LIBRARY WINSPOOL.DRV However, the libwinspool.a binary that is produced from this file contains the string "winspool.dll", but not "winspool.drv". Looking at the make output reveals the culprit: mingw32-dlltool --as mingw32-as -k --dllname winspool.dll --def ../w32api-4.0.0-1-mingw32-src/lib/lib32/winspool.def --output-lib libwinspool.a The build system is explicitly telling dlltool to use winspool.dll as the dll name rather than the library name that appears in the .def file. Replacing the string "winspool.dll" in the libwinspool.a binary with "winspool.drv" makes everything work fine, suggesting that winspool.drv is the correct library, and thus the .def file is just fine. The problem is with the build system. Were there recent changes to the build system that may have introduced this behaviour since the w32api version that shipped with gcc 4.7.2? Regards, Nate |