delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/21/12:15:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <41505394.9020105@atosorigin.com>
Date: Tue, 21 Sep 2004 16:15:16 +0000
From: =?ISO-8859-1?Q?Fr=E9d=E9ric_ORMANCEY?= <frederic DOT ormancey AT atosorigin DOT com>
Reply-To: frederic DOT ormancey AT atosorigin DOT com
Organization: AtosOrigin
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.6) Gecko/20040113
MIME-Version: 1.0
To: Cygwin List <cygwin AT cygwin DOT com>
Subject: Re: Lot of undefined symbols at link time, even with -l option on good libraries
References: <414FF698 DOT 4010702 AT atosorigin DOT com> <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040921091604 DOT 03d5b528 AT pop DOT prospeed DOT net>
In-Reply-To: <6.1.0.6.0.20040921091604.03d5b528@pop.prospeed.net>
X-IsSubscribed: yes
Note-from-DJ: This may be spam

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 AT 28
                     U __head_libkernel32_a
    00000000 I __imp__FormatMessageA AT 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.

Larry Hall a écrit :

>At 05:38 AM 9/21/2004, you wrote:
>  
>
>>Using latest release of CygWin ( 1.5.11-1 ) I install the devel kit,
>>
>>including gcc and gnat compilers. Then I build from src GCC and GNAT release 3.4.1 ( which include necessary patchs for my application ).
>>All my Ada application compile well with gnatmake command, but link failed with a lot of undefined symbols mainly issued from w32api and system libraries.
>>
>>Undefined symbols are for example : FormatMessageA, GlobalReAlloc, CreateDialogParamA, WSAStartup, accept, select, ... about 100 undefined from system libraries.
>>Of course system libraries are included at link time with the appropriate -l option ( -lnetapi32 -lwsock32 -lshell32 -ladvapi32 -lwinmm -lodbc32 -lwin32ada -luser32 -lgdi32 -lcomdlg32 -laddr2line -lbfd -liberty )
>>I verify with NM command, symbols are right defined in the included libraries.
>>
>>If someone have an idea ?
>>    
>>
>
>Sure.  Follow the problem reporting guidelines given here:
>
>  
>
>>Problem reports:       http://cygwin.com/problems.html
>>    
>>
>
>
>That will give those on the list interested in helping you out with this 
>problem at least the basic information about your system and what you're 
>doing.  
>
>My WAG is that you haven't declared these symbols properly so that the 
>calling convention is wrong (__cdecl vs __stdcall) but I'd need to see 
>a small example of your code, how you compile it, and what the errors
>are to be sure.  Then again, maybe this idea is enough for you to have an 
>"AHA!" moment and fix the problem yourself. :-)
>
>
>--
>Larry Hall                              http://www.rfk.com
>RFK Partners, Inc.                      (508) 893-9779 - RFK Office
>838 Washington Street                   (508) 893-9889 - FAX
>Holliston, MA 01746                     
>
>
>--
>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/
>
>
>  
>

-- 

*_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 
frederic DOT ormancey AT atosorigin DOT com <mailto:frederic DOT ormancey AT atosorigin DOT com>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019