Subject: Re: Lot of undefined symbols at link time, even with -l option on good libraries
From: Frédéric ORMANCEY <[email-masked]>
To: Cygwin List <[email-masked]>
Date: Wed, 22 Sep 2004 12:30:52 +0000

problem seems coming from trailing @nn in library symbols.
cygwin linker don't know how to translate a reference like 
_FormatMessageA to _FormatMessageA@28
the calling convention ( C, Stdcall, C++, ... ) has effect only on 
underscore preceeding symbol name, not on @nn notation.

It seems there is no solutions to this problem, I will abandon cygwin to 
build my Ada application under windows :-(

Larry Hall a écrit :

>At 12:15 PM 9/21/2004, you wrote:
>  
>
>>I think you're right, it seems to be a problem with trailing underscore in function naming.
>>For example :
>>
>>in /usr/lib/w32api/libkernel32.a we found :
>>
>>  00000000 T _FormatMessageA@28
>>                   U __head_libkernel32_a
>>  00000000 I __imp__FormatMessageA@28
>>
>>which is required by win32-winbase.o, result of the build of /usr/lib/gcc/win32ada/win32-winbase.adb
>>       U _FormatMessageA
>>       U _FormatMessageW
>>       U _GlobalReAlloc
>>       U _LocalReAlloc
>>
>>The source code for this part is the following :
>> pragma Import (Stdcall, Doit, "FormatMessageA");
>>
>>I try change it with pragma Import (C, Doit, "_FormatMessageA"); or things like that with no success.
>>
>>May be it's the trailing @28 after symbol name which cause error, but I cannot control it ( it's DLL calling convention parameter size ). Compiler/linker should usually add or remove trailing @nn if necessary.
>>
>>To answer your general questions, I'am building a large Ada application ( 200 source files ), using W32 API, with Win2000 GNAT Compiler.
>>
>>    
>>
>
>
>Sorry, I know nothing about Ada and how it works.  If the "pragma" statement
>is supposed to take the place of the traditional function prototype in C/C++,
>then I agree that it looks "OK" (again, based on my knowledge of Ada).  But
>the result is that it's looking for symbols that use the 'C' calling 
>convention rather than the 'stdcall' calling convention.  The libraries you
>are linking to want the 'stdcall' calling convention (since it is the 
>default for Windows).  If you cannot get Ada to ask for the proper symbol, 
>you could try using the '--enable-stdcall-fixup' option (for 'ld') to 
>attempt to massage away the problem.  
>
>
>
>--
>Larry Hall                              http://www.rfk.com
>RFK Partners, Inc.                      (508) 893-9779 - RFK Office
>838 Washington Street                   (508) 893-9889 - FAX
>Holliston, MA 01746                     
>
>
>  
>

-- 

*_Frédéric  ORMANCEY_*

Atos Origin Systems Integration  

/rue Ampère - BP 475  
31315 Labège Cedex/

/Tel// /: 05 61 39 75 21
/Fax /: 05 61 39 16 65 
[email-masked] <mailto:[email-masked]>
www.si.fr.atosorigin.com

=======================================================================================================
Ce message électronique est confidentiel. Il peut contenir des 
informations protégées par le secret professionnel, le secret de 
fabrication ou autres règles légales. Si vous recevez ce message par 
erreur, il vous est interdit de le reproduire ou de le distribuer en 
tout ou partie, ou de le divulguer de quelque manière que ce soit à 
quelque personne que ce soit. Nous vous prions de bien vouloir en 
informer Atos Origin, par téléphone ou par retour d'e-mail puis de 
détruire le message et toutes copies de votre système informatique.
Le contenu de ce message ne reflète pas nécessairement ni les opinions 
d'Atos Origin ni celles des membres de son groupe. Bien que l'émetteur 
de ce message ait fait tout son possible pour maintenir son système 
informatique sans virus, il ne peut garantir que cette transmission ne 
comporte aucun virus et il ne pourra être tenu pour responsable de 
quelque dommage que ce soit résultant de la transmission d'un virus.
=======================================================================================================

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/