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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,87b8cfa03eafd839 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!e56g2000cwe.googlegroups.com!not-for-mail From: "cybersaga" Newsgroups: comp.lang.ada Subject: Re: DLL Troubles Date: 19 Mar 2006 12:23:47 -0800 Organization: http://groups.google.com Message-ID: <1142799827.205623.17800@e56g2000cwe.googlegroups.com> References: <1142793974.914652.154480@t31g2000cwb.googlegroups.com> <1142796431.668418.58250@g10g2000cwb.googlegroups.com> <1142796624.038913.199600@u72g2000cwu.googlegroups.com> <441DBB5D.7070401@obry.net> NNTP-Posting-Host: 69.49.45.202 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1142799832 22239 127.0.0.1 (19 Mar 2006 20:23:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 19 Mar 2006 20:23:52 +0000 (UTC) In-Reply-To: <441DBB5D.7070401@obry.net> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e56g2000cwe.googlegroups.com; posting-host=69.49.45.202; posting-account=2ELL3w0AAABA6Hu9BtxJuf-wgpQRCSl8 Xref: g2news1.google.com comp.lang.ada:3467 Date: 2006-03-19T12:23:47-08:00 List-Id: Actually, I am using a project file, for both the dll and the main program. Here's what the DLL's project contains: -------mydll.gpr--------------------- project Mydll is for Source_Files use ("mydll.adb", "mydll.ads"); for Library_Name use "mydll"; for Library_Kind use "dynamic"; for Library_Dir use "dll"; end Mydll; ------------------------------------- As to "linking directly to the DLL", I need to be able to load the DLL dynamically. I'm beginning to believe this problem stems from my lack of an AdaInit call, as mentioned in the second post. However, I can't seem to get an AdaInit call to work. This is what I added to mydll.adb: ---- procedure InitMe is procedure AdaInit; pragma Import (C, AdaInit); begin AdaInit; end InitMe; --- I of course exported that procedure (InitMe) as well. However, when compiling, I get an error: f:\shs\bugtest\mydll.adb:19: undefined reference to `adainit' Line 19 is of course my call to AdaInit. Am I doing this correctly? Also, do I need to import using C if I'll only be using this in an Ada program? Can I do something like "Import (Ada, AdaInit)"? (This of course doesn't solve the compile problem, I tried).