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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder02.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: .h header file in ObjectAda 8.2.2 source code? Date: Sat, 20 Jul 2013 00:41:35 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <54f7f0d4-29ef-4de0-94d8-8320e8df24e2@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1374298900 1456 69.95.181.76 (20 Jul 2013 05:41:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 20 Jul 2013 05:41:40 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 2772 Xref: number.nntp.dca.giganews.com comp.lang.ada:182602 Date: 2013-07-20T00:41:35-05:00 List-Id: "dd24fan" wrote in message news:b42127a4-c5dc-4fd0-86cd-dd63f014897b@googlegroups.com... ... > The program runs on a PC Windows environment. It does not hang in the ada > main subprogram execution. > > I believe it to hang in the first call to the C code. Typically, that means that there is a mistake in the specifications of the functions that are imported with pragma Import. As to finding the actual problem, usually all you can do it step through the bad call with a debugger and see what it is doinng wrong (sometimes you have to compare it to a call from C that works). The problem with interfacing to a foreign language is that the Ada compiler is helpless to provide you much if any help. Only the most gross errors can be detected, because the Ada compiler doesn't know anything about the C code other than what you tell it, and if you tell it the wrong thing... When we wer building Claw, we spent a *lot* of time debugging botched Imports, and we never really found a shortcut (other than triple-checking the imported function declarations before cracking out the debugger, probably half the time, the problem became evident). Humm, you mentioned that this is on Windows. Do you know if these are C-convention or Stdcall-convention functions? Use the wrong one, and nothing will work. (Win32 is Stdcall, for instance, *not* C). For Stdcall, you need to get the number of parameters the same as C expects, or you will have problems (although those usually are an inability to link). Randy.