* MinGW GNAT 3.4.4 linking problem
@ 2005-10-14 10:10 michael bode
2005-10-14 12:56 ` michael bode
0 siblings, 1 reply; 2+ messages in thread
From: michael bode @ 2005-10-14 10:10 UTC (permalink / raw)
Hi,
I'm trying out the MinGW GNAT 3.4.4 and get the dreaded 'undefined
symbol' messages. Contrary to what another poster reported a while ago
this is not for the GNAT libraries but only for 3rd party libs.
That is Hello_World.adb (or the GNAT dining philosophers example)
compiles and links fine, so I suppose the install went ok. But my code
which uses a 3rd party library get's 'undefined symbol' for each and
every function I call.
The library uses StdCall conventions and I have the .dll and .lib
compiled with Microsoft VC98. Interestingly everything work fine with
GNAT 3.15p. When I change the PATH to point to C:\MINGW\bin instead
C:\GNAT\bin -> 'undefined symbol'.
Are there some changes to linker options etc. that I might have
overlooked? Any Ideas?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: MinGW GNAT 3.4.4 linking problem
2005-10-14 10:10 MinGW GNAT 3.4.4 linking problem michael bode
@ 2005-10-14 12:56 ` michael bode
0 siblings, 0 replies; 2+ messages in thread
From: michael bode @ 2005-10-14 12:56 UTC (permalink / raw)
michael bode <michael.bode@laserline.de> writes:
> The library uses StdCall conventions and I have the .dll and .lib
> compiled with Microsoft VC98. Interestingly everything work fine with
> GNAT 3.15p. When I change the PATH to point to C:\MINGW\bin instead
> C:\GNAT\bin -> 'undefined symbol'.
Problem solved. The library exports names of the form '_function@N'
which is as I've learned typical for a MSVC .dll created with
__declspec(dllexport). Somehow gnat 3.4.4 expects names of the form
'function@N' without leading underscore. Proper solution: use
dll-tools and DEF files to mangle the names into 'function@N'
form. Simple solution: pragma Import (StdCall, function, "_function")
GNAT 3.15p is quite happy with pragma Import (StdCall, function,
"function"). Is that a well known change?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-14 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-14 10:10 MinGW GNAT 3.4.4 linking problem michael bode
2005-10-14 12:56 ` michael bode
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox