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.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d9ad419d8c604c82,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-24 09:06:32 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!easynet-thlon3!easynet.net!easynet-post1!not-for-mail From: "Xavier SAUTEJEAU" Newsgroups: comp.lang.ada Subject: Linking libraries from the command line using ObjectAda on Windows Date: Tue, 24 Jun 2003 18:17:51 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: <3ef87707$0$13736$afc38c87@news.easynet.fr> Organization: [posted via Easynet France] NNTP-Posting-Host: 212.180.111.231 X-Trace: DXC=lifM4=A]dm`1m3j=ZBaQ_mHAl49BR3iUge Hi Everyone, >From the command line, I'd like to know how to build an exe that links with a static library with ObjectAda. Here is the library I want to build. -- directory structure LibCall.adb -- file that calls the library Dummy.adb -- dummy file that Withs the library units + P_hello - P_hello.ads - P_hello.adb + P_hello_2 - P_hello2.ads - P_hello2.adb --P_hello2.ads package P_hello2 is procedure hello; end P_hello2; --P_hello2.adb With text_io;use text_io; package body P_hello2 is procedure hello is begin Put_Line("Hello library world 2"); end hello; end P_hello2; --P_hello.ads package P_hello is procedure hello; end P_hello; --P_hello.adb With text_io;use text_io; package body P_hello is procedure hello is begin Put_Line("Hello library world"); end hello; end P_hello; -- Dummy.adb With P_Hello; With P_Hello2; procedure Dummy is begin null; end dummy; To build the library I use the following commands adareg P_hello\*.ad* adareg P_hello_2\*.ad* adareg dummy.adb adamake adabuild dummy dir /s /b *.obj > list.txt lib /out:hello.lib @list.txt del /q list.txt ada.lib unit.map Here is the exe I want to build that links with the library. -- libcall.adb With P_Hello; With P_Hello2; procedure libcall is begin P_Hello.HELLO; P_Hello2.HELLO; end Libcall; To build the exe I use the following commands REM registering library search path adaopts -p. adaopts -lp . REM registering source files adareg P_hello_2\*.ads adareg P_hello\*.ads adareg libcall.adb adabuild libcall -ll hello And I get the following output: ObjectAda Special Edition Version 7.2.2: adabuild Copyright (c) 1997-2002 Aonix. All rights reserved. Front end of libcall.adb succeeded with no errors. Front end of p_hello_2\p_hello2.ads succeeded with no errors. Front end of p_hello\p_hello.ads succeeded with no errors. libcall: Error: Source not found for P_hello2, NO_KIND. Can't recompile. libcall: Error: Source not found for P_hello, NO_KIND. Can't recompile. libcall: Error: Body not found for P_hello2 libcall: Error: Body not found for P_hello libcall: Error: Link ended due to previous errors. Where did I go wrong ? Any help would be appreciated.