Bug #11149 2007-05-22 15:31

jimp

GNU GCC DLL Linker Options

In a Windows GNU GCC DLL compile I have the linker parameter --add-stdcall-alias. It is sent to the linker by CodeBlocks as a compiler option instead of a linker option. No error is reported but the option is not processed. Without --add-stdcall-alias I get a run-time error because the calling program cannot find the procedure. The current linker call is like this:

mingw32-g++.exe -shared -Wl,--dll objDll\AStyle\src\ASEnhancer.o objDll\AStyle\src\ASFormatter.o objDll\AStyle\src\ASResource.o objDll\AStyle\src\astyle_main.o objDll\AStyle\src\ASBeautifier.o -o bin\AStyle.dll -s --add-stdcall-alias.

To be called correctly the options should be sent like this:

mingw32-g++.exe -shared -Wl,--dll,--add-stdcall-alias objDll\AStyle\src\ASEnhancer.o objDll\AStyle\src\ASFormatter.o objDll\AStyle\src\ASResource.o objDll\AStyle\src\astyle_main.o objDll\AStyle\src\ASBeautifier.o -o bin\AStyle.dll -s

The linker options follow -Wl separated by commas and without spaces. I can correct the problem temporarily by declaring the linker option as -Wl,--add-stdcall-alias.

Category
 
Group
 
Status
Open
Close date
 
Assigned to
 
ID_44756 2008-03-23 00:54

Workaround:

-Xlinker --add-stdcall-alias