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=-1.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,16656275b5169989 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-29 15:30:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: sk Newsgroups: comp.lang.ada Subject: Re: Link C main with Ada static library Date: Fri, 29 Nov 2002 17:25:09 -0600 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1038612602 88635 137.194.161.2 (29 Nov 2002 23:30:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 29 Nov 2002 23:30:02 +0000 (UTC) Return-Path: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020828 X-Accept-Language: en-us, en Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:31319 Date: 2002-11-29T17:25:09-06:00 Hi, jeff.huter@bigfoot.com : > I have been unable to get it work using -L switch of > gnatbind as outlined in the manual I have lost my 3.14p docs and have only just installed 3.15p, but it seems that the gnatbind "-L" switch is new (undoubtdly wrong, but I hadn't noticed "-L" for gnstbind before). ... but (following from previous example) ... -- main.c extern int return_forty_two (); extern int mylibinit (); extern int mylibfinal (); #include int main () { int i = 0; printf ("i => %d\n", i); mylibinit (); i = return_forty_two (); mylibfinal (); printf ("i => %d\n", i); }; ... the build ... # gnatmake static_ada_library # gnatbind -Lmylib static_ada_library # gcc -c b~static_ada_library.adb # ar cr libmylib.a b~static_ada_library.o static_ada_library.o # gcc main.c -o c-test -lmylib -L. \ usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/adalib/libgnat.a # ./c-test i => 0 i => 42 # -- For real address, merge vertically ------------------- -- s n p @ t . o -- k i e k c c m -------------------