0
votes

I'm using gnatmake to build my Ada project and I get the following warning:

Warning: resolving _LoadLibraryA by linking to _LoadLibraryA@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _GetProcAddress by linking to _GetProcAddress@8

I'm trying to pass --endable-stdcall-fixup to gnatmake but claims it's not a switch, how can I pass linker options through gnatmake?

gnatmake --enable-stdcall-fixup main.adb
gnatmake: invalid switch: --enable-stdcall-fixup

(1) EDIT:

Upon using the changes suggested by the answer, I still get the same error, yet it appears to be correctly passing to the linker this time.

gnatmake main.adb -f -largs --enable-stdcall-fixup
gcc -c main.adb
gcc -c winapi.ads
gnatbind -x main.ali
gnatlink main.ali --enable-stdcall-fixup
Warning: resolving _LoadLibraryA by linking to _LoadLibraryA@4
Use --enable-stdcall-fixup to disable these warnings
Use --disable-stdcall-fixup to disable these fixups
Warning: resolving _GetProcAddress by linking to _GetProcAddress@8
1
-largs -foo means to pass -foo to gnatlink; but gnatlink is a front-end to the actual linker, and may not be passing it through to where it’s needed. Try -largs -Wl,--enable-stdcall-fixup (-Wl means to pass through to the actual linker, -Wc to the actual compiler)Simon Wright
@SimonWright You were right! Thank you!jacob

1 Answers

1
votes

Try -largs opts

From gnatmake --help:

To pass an arbitrary switch to the Compiler, Binder or Linker:
-cargs opts opts are passed to the compiler
-bargs opts opts are passed to the binder
-largs opts opts are passed to the linker
-margs opts opts are passed to gnatmake