From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b9c1989248a6cf47 X-Google-Attributes: gid103376,public From: "Mark" Subject: Re: Linking to c++ libraries problem Date: 1998/08/19 Message-ID: <01bdcb93$05b85740$0f010180@nc84c>#1/1 X-Deja-AN: 382581653 X-NNTP-Posting-Host: lourow.demon.co.uk:212.228.41.146 References: <01bdcb09$d79eba90$0f010180@nc84c> X-Trace: news.demon.co.uk 903517588 nnrp-06:21749 NO-IDENT lourow.demon.co.uk:212.228.41.146 Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 1998-08-19T00:00:00+00:00 List-Id: Jerry van Dijk wrote in article ... > Mark (wilson_m_r@yahoo.com) wrote: > > : I am using the Gnat ada compiler to link an ada program with functions > : defined in c++ . libraries (Microsoft Visual c++ v5). > > Ok. Assuming you are using 3.10p. Correct. > > : The problem I am having is that the c++ libraries make use of C++ library > : functions (like printf) > > Actually, printf is a C library function, in C++ you would use the > cout stream. > I am using libraries that have been created using Microsoft Visual c++ v5 which I presume has an c compiler built in. > : and when I link using the Gnat ada compiler I get > : undefined references to a host of things (like _imp__fprintf). > > : I think that I want to add to this a library to resolve the missing > : declarations but I am not sure what the library is. > > : Is this library available within gnat? > > Since you are calling a C library function I am calling a c function that has been resolved by the list of provided libraries, the library functions that I'm calling then make use of standard c functions like printf. > , it tries to link to the > MS C runtime DLL import library. GNAT links in the gcc style import > library to this dll, which has a different format, so, the function > is not found. > > The easiest way out is to recompile your C or C++ code using gcc. I do not have the source, only the ".lib" files. > (if it is C code, the C compiler is included with gnat). If that is > not possible, recompile the C++ code as a dll and import this through > a package. See my homepage: http://stad.dsl.nl/~jvandyk for more info. At present I'm asking the supplier of the libraries to provide me with the dlls. Has this not already been done before for the standard c and c++ libraries? Thanks for the help Mark Whats for you wont go by you!