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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,6f1f065a3ff6bcf0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-26 21:57:19 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!wn13feed!worldnet.att.net!204.71.34.3!newsfeed.cwix.com!nsnmpen1-lo.nuria.telefonica-data.net!telenews.teleline.es!not-for-mail X-Trace-PostClient-IP: 81.61.181.19 From: "Nando" Newsgroups: comp.lang.ada References: Subject: Re: Import C X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 Message-ID: Date: Tue, 27 Jan 2004 05:56:42 GMT NNTP-Posting-Host: 10.20.31.4 X-Complaints-To: usenet@teleline.es X-Trace: telenews.teleline.es 1075183002 10.20.31.4 (Tue, 27 Jan 2004 06:56:42 MET) NNTP-Posting-Date: Tue, 27 Jan 2004 06:56:42 MET Organization: Terra Networks Xref: archiver1.google.com comp.lang.ada:4879 Date: 2004-01-27T05:56:42+00:00 List-Id: Yes... I mean "pragma Import"... sorry for my english :)) I have download several documentation from http://www.lawebdelprogramador.com, and searching in internet "ADA reference manual". I also have read the documentation that my compiler has and I have opened and studied the examples... but they don't word :(( My operating system is Windows XP, and I am writing my own serial device driver. I am using the "GNAT ADA 95 COMPILER" Thank's you for the url :)) The simple code example is very usefull for me. Now I try to call C routines from my Ada compiler. Thanks you for your help. Fernando "Stephen Leake" escribi� en el mensaje news:mailman.19.1075128729.2270.comp.lang.ada@ada-france.org... > "Nando" writes: > > > Hello!!! > > I need make an Ada application. I need send and receive some information > > to/from the serial port communication (from PC to another device). > > What operating system are you using? PCs run several operating systems > (Mac, Linux, Windows, Solaris, ...). > > > I don't know how to do it in Ada, but I know to do it in C/C++. I > > have found the command "pragma inport(C, ...)" but I don't know how > > it works :(( > > I think you mean "pragma Import". > > What manuals and/or books have you read? > > > * Is enough the .C and .H files or I need the object file? > > You actually need the operating system serial interface object files, > not your object files or source files. > > > * How my Ada code know what file has my subrutine? i.e., where I say > > in my Ada source code what files to include? > > Hmm. Are you writing your own serial device driver? Or maybe you've > written a layer over the operating system layer, in C, and you want to > call that layer from Ada. If that's true, you do need to link in the > object files produced from your C code. > > You specify what files to link on the linker command line. You need to > say what compiler you are using for me to be more specific. > > > If you could give me a little example or documentation you would > > help me very much. > > An example of a simple application using a serial port from Windows is > at http://www.toadmail.com/~ada_wizard/; get the "com_ports" file. > > Hope this helps. > > -- > -- Stephe >