Anyone on the list have some pointers for getting swig working properly on Windows? Anytime I reswig a file it breaks wx.cpp. I''m sure I''ve got a setup problem but I haven''t been able to put my finger on it yet. Roy
Roy Sutton wrote:> Anyone on the list have some pointers for getting swig working properly > on Windows? Anytime I reswig a file it breaks wx.cpp. I''m sure I''ve > got a setup problem but I haven''t been able to put my finger on it yet.Sorry I didn''t have a chance to look at this sooner. It definitely looks like a swig version problem. I''m still using 1.3.22 (because that''s what''s in Ubuntu stable/Hoary). The message you posted earlier showed this: > swig -runtime -w401 -w801 -w515 -c++ -ruby -o src/wx.cpp swig/wx.i > SWIG(1): Warning(120): -c, -runtime, -noruntime command line options are deprecated. > ruby swig/renamer.rb src/wx.cpp > ruby swig/fixmainmodule.rb src/wx.cpp And -runtime is what we use with wx.i and not with the other modules. It looks like there is no way to have .i files that would work with both swig 1.3.22 and 1.3.23 (or later) due to this change in swig. My new plan is to add a test in the rakefile that attempts to run ''swig -version''. If it can''t find it, or if the version is not 1.3.22, then avoid creating the swig tasks. This way, it will just use the files in src/ even if the .i files are newer. At some point, we can figure out how to make it work with 1.3.24, and the rakefile can adjust accordingly. I certainly wouldn''t complain if someone else got to this before I have a chance to :-) Kevin
> At some point, we can figure out how to make it work with 1.3.24, and > the rakefile can adjust accordingly.It swigs and works fine for me with 1.3.24 if I delete the -runtime flag. Jani
Jani Monoses wrote:>>At some point, we can figure out how to make it work with 1.3.24, and >>the rakefile can adjust accordingly. > > > It swigs and works fine for me with 1.3.24 if I delete the -runtime flag.Very odd. The swig folks claimed at one point that since -runtime and -noruntime are ignored by 1.3.24, it would make no difference whether you had them or not. I wonder why that''s not true. You still have the -noruntime flag for the class file swigs, right? Do you get warnings that it is deprecated? Kevin
On 8/4/05, Kevin Smith <wxruby@qualitycode.com> wrote:> Jani Monoses wrote: > >>At some point, we can figure out how to make it work with 1.3.24, and > >>the rakefile can adjust accordingly. > > > > > > It swigs and works fine for me with 1.3.24 if I delete the -runtime flag.Sorry, it worked even with that flag too. It just warns that''s why I removed it. Ocassionally it said SWIG_RubyInitRuntime missing when starting the apps but usually a rebuild fixed that. Jani
I thought I''d try reswigging everything from scratch with a ''rake reswig'' then a ''rake''. If I reswig then I can''t compile Icon.cpp with the following error: src/Icon.cpp(1207) : error C2666: ''wxIcon::wxIcon'' : 2 overloads have similar conversions Exception `RuntimeError'' at c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] I''ll check into this later.
Roy Sutton wrote:> I thought I''d try reswigging everything from scratch with a ''rake > reswig'' then a ''rake''.Good. I was going to suggest that. It probably isn''t safe to only reswig some of the files if you are using a different version of swig.> If I reswig then I can''t compile Icon.cpp with the following error: > > src/Icon.cpp(1207) : error C2666: ''wxIcon::wxIcon'' : 2 overloads have > similar conversions > Exception `RuntimeError'' at > c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command > failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...]Hm. I''ve never seen anything like that. Can you post line 1207 with some context so we can see what''s failing? My Icon.cpp only has 1093 lines total. Swig has been a great tool, but I''m not happy with the way the swig project is managed. They go too long between releases, and tend to break too much stuff too often (like the -runtime deprecation). Hopefully we can figure something out. Kevin
Line 1207 reads: result = (wxIcon *)new wxIcon((wxString const &)*arg2,arg3,arg4); This is in function _wrap_new_wxIcon__SWIG_1(int argc, VALUE *argv, VALUE self) Kevin Smith wrote:>> If I reswig then I can''t compile Icon.cpp with the following error: >> >> src/Icon.cpp(1207) : error C2666: ''wxIcon::wxIcon'' : 2 overloads have >> similar conversions >> Exception `RuntimeError'' at >> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command >> failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] > > > Hm. I''ve never seen anything like that. Can you post line 1207 with > some context so we can see what''s failing? My Icon.cpp only has 1093 > lines total.
If I cast arg3 as a long it will compile. I''m /pretty/ sure that: wxIcon::wxIcon(const wxString& iconfile, long flags, int desiredWidth, int desiredHeight) Is the wxIcon constructor that''s desired. Roy Sutton wrote:> Line 1207 reads: > > result = (wxIcon *)new wxIcon((wxString const &)*arg2,arg3,arg4); > > This is in function _wrap_new_wxIcon__SWIG_1(int argc, VALUE *argv, > VALUE self) > > Kevin Smith wrote: > >>> If I reswig then I can''t compile Icon.cpp with the following error: >>> >>> src/Icon.cpp(1207) : error C2666: ''wxIcon::wxIcon'' : 2 overloads >>> have similar conversions >>> Exception `RuntimeError'' at >>> c:/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake.rb:485 - Command >>> failed with status (2): [cl.exe -c -IC:\RubyDev\wxWidgets-2.6.1/inc...] >> >> >> >> Hm. I''ve never seen anything like that. Can you post line 1207 with >> some context so we can see what''s failing? My Icon.cpp only has 1093 >> lines total. > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users > > >