From: SourceForge.net <no...@so...> - 2007-05-20 22:04:18
|
Bugs item #1722331, was opened at 2007-05-21 09:32 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1722331&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jim Pattee (jimp03) Assigned to: Nobody/Anonymous (nobody) Summary: --add-stdcall-alias and -shared options Initial Comment: * OS version ( Windows XP ) * gcc version ( 3.4.2 ) * ld version ( 2.15.94 ) * mingw-runtime version ( 3.9 ) * w32api version ( 3.6 ) I have a program that loads a dll explicitly using LoadLibrary() and GetProcAddress(). GetProcAddress uses the UNDECORATED function name in the dll call. When the dll is compiled using dllwrap.exe and the option --add-stdcall-alias, the dll is called without a problem. When the dll is compiled using g++ with the -shared option and --add-stdcall-alias, the GetProcAddress fails with "The specified procedure could not be found." When I add the @16 suffix to the function name it is called correctly. It seems like the --add-stdcall-alias doesn't have an effect when g++ is used with the -shared option. Following is a copy of the command line used to call the linker. The file libAStyle.a is not used in linking the calling program. ----------------------------------------------- g++.exe -shared ../objd/ASBeautifier.o ../objd/ASEnhancer.o ../objd/ASFormatter.o ../objd/ASResource.o ../objd/astyle_main.o -L"C:/_jpFiles/Programs/Dev-Cpp/Lib" --add-stdcall-alias --no-export-all-symbols -s -Wl -Wl,--out-implib,../bin/libAStyle.a -o ../bin/AStyle.dll Creating library file: ../bin/libAStyle.a Execution terminated Compilation successful ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2007-05-21 10:04 Message: Logged In: YES user_id=11494 Originator: NO --add-stdcall-alias is a linker, not a compiler, option. You should have gotten a warng like: unrecognized command line option "-fadd-stdcall-alias" Try using -Wl,--add-stdcall-alias Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1722331&group_id=2435 |