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.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd85303b24b257e2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-03 07:11:16 PST Path: bga.com!news.sprintlink.net!EU.net!uunet!newsgate.watson.ibm.com!watnews.watson.ibm.com!ncohen From: ncohen@watson.ibm.com (Norman H. Cohen) Newsgroups: comp.lang.ada Subject: Re: Calling C++ from within ADA Date: 3 Nov 1994 15:11:16 GMT Organization: IBM T.J. Watson Research Center Distribution: world Message-ID: <39auik$129i@watnews1.watson.ibm.com> References: Reply-To: ncohen@watson.ibm.com NNTP-Posting-Host: rios8.watson.ibm.com Keywords: C++ ADA Date: 1994-11-03T15:11:16+00:00 List-Id: In article , CVANOVER@bamanet.ua.edu writes: |> Is there a way to call a C++ procedure from within ADA? I can call a C |> procedure with |> |> package C_LIB is |> procedure clear_screen; |> procedure sleep_a_moment; |> private |> pragma interface(c,clear_screen); |> pragma interface(c,sleep_a_moment); |> end C_LIB; |> |> However, when I compile the same C procedure in C++ I get the following error: |> 0706-317 ERROR: Unresolved or undefined symbols detected: |> Symbols in error (followed by references) are |> dumped to the load map. |> The -bloadmap: option will create a load map. |> .clear_screen |> |> I've tried adding INTERFACE_INFORMATION but it doesn't seem to help. |> |> I am using IBM AIX on an RS6000. The error message comes from the linker, ld, which is invoked by the compiler when you compile with -b or -m (to construct an executable main program). I suspect that your C++ compiler is creating a "mangled" external name for clear_screen, rather than the name .clear_screen created by your C compiler. Use the AIX nm command to see the external symbols in the .o file produced by your C++ compiler, and, if you can figure out which one is a mangled name for clear_screen, adjust your Interface_Information pragma accordingly. -- Norman H. Cohen ncohen@watson.ibm.com