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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71c49bb637416afe,start X-Google-Attributes: gid103376,public From: "M. Smith" Subject: "system" Call in GNAT? Date: 1999/04/05 Message-ID: <3708E4C0.F13C2023@alphasoft-inc.com>#1/1 X-Deja-AN: 462875275 Content-Transfer-Encoding: 7bit To: Roga Danar X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: news1.exit109.com 923322306 2266 208.225.73.22 (5 Apr 1999 14:25:06 GMT) Organization: AlphaSoft, Inc. Mime-Version: 1.0 Reply-To: smithm-nospam@stelnj.com NNTP-Posting-Date: 5 Apr 1999 14:25:06 GMT Newsgroups: comp.lang.ada Date: 1999-04-05T14:25:06+00:00 List-Id: Hi All, I was looking for a call in GNAT that would make invoke a command to the OS for me and I found the function "system" and "execl". Unfortunatly, I have not been able to link these either of these calls with my test driver. Am I missing something here? I have been only working for a short time with GNAT. My code and the error message follow. -- ***************************************************************** My code is => with Win32; with Win32.WinNT; with Win32.crt.Process; with Win32.Shellapi; with Interfaces.C; with Interfaces.C.Strings; with Ada.Text_Io; procedure Test_Command is use Ada; package C renames Interfaces.C; package C_Str renames C.Strings; Command_Str : C_Str.chars_ptr := C_Str.New_String("DIR T* "); Arg : String := "/w"; type int_ptr is access C.Int; args : int_ptr := new C.Int'(1); ppt_char : Win32.Shellapi.PPTCHAR := new Win32.PCHAR'(new C.CHAR'(c.nul)); status : C.Int := 0; begin ppt_char := Win32.Shellapi.CommandLineToArgvW ( Win32.To_PSTR (Command_Str), args); text_io.put (C.To_Ada (ppt_char.all.all)); text_io.put_line (C_Str.Value (Command_Str)); -- status := Win32.crt.Process.system (p1 => Win32.To_PCSTR (Command_Str)); status := Win32.crt.Process.execl (cmdname => Win32.To_PCSTR (Command_Str)); end Test_Command; --******************************************************* The Error message is => gnatbind -aO./ -aOC:\usr\lib\gcc-lib\i586-pc-mingw32\2.7.2\adainclude;C:\My_Work;C:\My_Work\Win32Ada\src;C:\My_Work\Jeff\Communication;C:\My_Work\Jeff\Database;C:\My_Work\Jeff\Communication;C:\My_Work\Jeff\Database;C:\My_Work\Jeff\Executive;C:\My_Work\Jeff\Misc;C:\My_Work\database\odbc;C:\My_Work\database\sql;C:\USR\lib\gcc-lib\i586-pc-mingw32\2.7.2\adalib -I- -x Test_Command.ali gnatlink -mwindows -lodbc32 Test_Command.ali ./stdarg-inst.o(.text+0xb9):stdarg-inst.ad: undefined reference to `to_long' ./stdarg-inst.o(.text+0x69b):stdarg-inst.ad: undefined reference to `to_long' ./stdarg-inst.o(.text+0xf67):stdarg-inst.ad: undefined reference to `to_long' ./stdarg-inst.o(.text+0x1829):stdarg-inst.ad: undefined reference to `to_double' ./stdarg-inst.o(.text+0x1b15):stdarg-inst.ad: undefined reference to `to_double' ./win32-crt-process.o(.text+0x4dd):win32-crt-process.adb: undefined reference to `do_varargs' ./win32-crt-process.o(.text+0x718):win32-crt-process.adb: undefined reference to `do_varargs' ./win32-crt-process.o(.text+0x911):win32-crt-process.adb: undefined reference to `do_varargs' ./win32-crt-process.o(.text+0xb4c):win32-crt-process.adb: undefined reference to `do_varargs' ./win32-crt-process.o(.text+0xd66):win32-crt-process.adb: undefined reference to `do_varargs' ./win32-crt-process.o(.text+0xfc1):win32-crt-process.adb: more undefined references to `do_varargs' follow gnatmake: *** link failed. Process completed with exit code 2