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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.ada:3504 comp.sys.hp:4635 Path: utzoo!attcan!uunet!mcsun!isgate!krafla!valdi From: valdi@rhi.hi.is (Thorvaldur Sigurdsson) Newsgroups: comp.lang.ada,comp.sys.hp Subject: Unix (HP-UX) system calls from ADA Keywords: ADA Message-ID: <1587@krafla.rhi.hi.is> Date: 20 Mar 90 15:57:34 GMT Organization: University of Iceland List-Id: Subject: Unix (HP-UX) system call from ADA Newsgroups: comp.sys.hp,comp.lang.ada Keywords: ADA Problem : Making unix system calls within Ada code Background : HP-UX 6.5, HP 9000/300 series, Alsys 4.35 Ada compiler Error message : ld: Undefined external - _ll _clear ld: output file still contains undefined symbols ld: (Warning) did not generate an output file ada: Errors detected Manual : Reference Manual for the Ada Programming Language, Appendix F, page F-5, chapter F 1.1.4 Additional Information on INTERFACE and INTERFACE_NAME : "When you want to call an HP-UX system call from Ada code, you should use a pragma INTERFACE with C as the language name. It is not necassary to provide the C object file to the binder, because it will be found automatically when the linker searches the system library". Question : Is the manual wrong concerning automatic linking or am I doing something wrong in the code ? Source code : main.ada, system.ads main.ada : The following source is the main procedure -- ************************************************ -- * ABSTRACT: Main program * -- ************************************************ procedure MAIN is begin UNIX_SYSTEM_CALL.clear; UNIX_SYSTEM_CALL.ll; end MAIN; system.ads : The following source is the unix_system_call package -- ************************************************ -- * ABSTRACT: Package specification * -- ************************************************ package UNIX_SYSTEM_CALL is procedure clear; procedure ll; private pragma INTERFACE (C, clear); -- clear display pragma INTERFACE (C, ll); -- long list end UNIX_SYSTEM_CALL; -- package specification P.S. : I tried also implementing the usage of INTERFACE_NAME without results. ------------------------------------------------------------------------ Thorvaldur Egill Sigurdsson | Engineering Research Institute | Internet: valdi@kerfi.hi.is University of ICELAND | Hjardarhagi 2-6 | Phone: 354-1-694699 107 Reykjavik, ICELAND | ------------------------------------------------------------------------