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,FREEMAIL_FROM, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,95dad6602b955ce1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g49g2000cwa.googlegroups.com!not-for-mail From: "Lucretia" Newsgroups: comp.lang.ada Subject: Re: Problem with "limited with" in a *real* application Date: 13 Oct 2005 07:50:04 -0700 Organization: http://groups.google.com Message-ID: <1129215004.069760.84050@g49g2000cwa.googlegroups.com> References: <1129043820.987947.200870@z14g2000cwz.googlegroups.com> <1129136767.955381.143030@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: 194.74.199.42 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1129215009 17941 127.0.0.1 (13 Oct 2005 14:50:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 13 Oct 2005 14:50:09 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 Symantec_Web_Security (3.0.1.74), 1.0 C2100-0050414028 (NetCache NetApp/5.5R5) Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=194.74.199.42; posting-account=G-J9fgwAAADgpzBiEyy5tO4f8MX5fbpw Xref: g2news1.google.com comp.lang.ada:5596 Date: 2005-10-13T07:50:04-07:00 List-Id: Ok, so I tried the above and got it compiling, so I tried to remove the "access" in an attempt to make the interface a bit cleaner and there are more problems... ... limited with wx.Core.Sizer; package wx.Core.Window is -- This is the actual type (wxWindow) we are creating here. type Window_Type is new Event_Handler_Type with private; ... procedure Set_Sizer( Self : in Window_Type; Sizer : in wx.Core.Sizer.Sizer_Type; Delete_Old_Sizer : in Boolean := True); ... end wx.Core.Window; ... with wx.Core.Sizer; use wx.Core.Sizer; package body wx.Core.Window is ... procedure Set_Sizer( Self : in Window_Type; Sizer : in wx.Core.Sizer.Sizer_Type; Delete_Old_Sizer : in Boolean := True) is procedure wxWindow_SetSizer( Self, Sizer : in System.Address; Delete_Old_Sizer : in C.int); pragma Import(C, wxWindow_SetSizer, "wxWindow_SetSizer"); Delete_Old_Sizer_Converted : C.int := 0; begin if Delete_Old_Sizer = True then Delete_Old_Sizer_Converted := 1; end if; wxWindow_SetSizer(Get_wxObject(Self), Get_wxObject(Sizer), Delete_Old_Sizer_Converted); end Set_Sizer; ... end wx.Core.Window; I've had to cast the sizer type to the base sizer in the Set_Sizer procedure call: package body Minimal_Frame is ... procedure New_Minimal_Frame(Self : in out Minimal_Frame_Type) is ... begin ... Set_Sizer(Window_Type(Self.Panel), Sizer_Type(Self.Sizer)); ... end New_Minimal_Frame; ... end Minimal_Frame; But for some reason, the app won't link because Set_Sizer is undefined: gnatlink minimal.ali -o minimal -lwxada -L../../src -L/home/laguest/opt/wxGTK/lib -pthread -lwx_gtk2d_xrc-2.6 -lwx_gtk2d_qa-2.6 -lwx_gtk2d_html-2.6 -lwx_gtk2d_dbgrid-2.6 -lwx_gtk2d_adv-2.6 -lwx_gtk2d_core-2.6 -lwx_based_odbc-2.6 -lwx_based_xml-2.6 -lwx_based_net-2.6 -lwx_based-2.6 ../../src/ada/wx-core-window.o(.text+0x5b37): In function `wx.core.window._elabs': /home/laguest/src/svn-controlled/wxAda/src/ada/wx-core-window.ads:318: undefined reference to `wx__core__window__set_sizer' ../../src/ada/wx-core-window.o(.text+0x5b48):/home/laguest/src/svn-controlled/wxAda/src/ada/wx-core-window.ads:318: undefined reference to `wx__core__window__set_sizer' ./minimal_frame.o(.text+0x11d5): In function `minimal_frame.new_minimal_frame': /home/laguest/src/svn-controlled/wxAda/samples/minimal/minimal_frame.adb:214: undefined reference to `wx__core__window__set_sizer' collect2: ld returned 1 exit status gnatlink: cannot call /opt/gcc-4.1-20050902/bin/gcc And, yes wx-core-window.ad[sb] is getting compiled, I have already mde sure of that by deleting the object and then recompiling and then doing an objdump on wx-core-window.o only to find that set_sizer is undefined for some reason! But, ultimately I don't want to be casting all the time, so if I change the specification of the procedure of Set_Sizer to read: ... procedure Set_Sizer( Self : in Window_Type; Sizer : in wx.Core.Sizer.Sizer_Type'Class; Delete_Old_Sizer : in Boolean := True); ... and similarly in the body, things gets even weirder: gcc -c -g -gnatf -gnatwj -gnat05 wx-core-window.adb wx-core-window.adb:737:46: not type conformant with declaration at wx-core-window.ads:141 wx-core-window.adb:737:46: type of "Sizer" does not match gnatmake: "wx-core-window.adb" compilation error What's going on in these cases? Thanks, Luke.