From: Dario A. <dar...@im...> - 2010-03-05 00:01:47
|
Thanks for your reply. I was putting together a minimal example for you to demonstrate the issue but was unable reproduce it. So I went backed and carefully looked at swigs output with the first things I tried on my project. It turns out our build system wasn't picking up the swig generated files (i.e. swig was generating the files as expected). So, sorry for the false alarm. Thanks again, Dario From: David Piepgrass [mailto:dpi...@me...] Sent: Thursday, March 04, 2010 1:55 PM To: Dario Ahdoot; swi...@li... Subject: RE: Class derived from class declared in other library I see no obvious problem with your code as you described it. That library "A" is a static .lib doesn't matter to SWIG (how is SWIG even supposed to know?) Why don't you post a complete example of something that doesn't work, including the contents of your .i file? You do not state whether you are producing one SWIG module or two. I don't use multiple modules so, in the latter case, I couldn't personally help, but maybe someone else could. From: Dario Ahdoot [mailto:dar...@im...] Sent: Thursday, March 04, 2010 12:57 PM To: swi...@li... Subject: [Swig-user] Class derived from class declared in other library Hi, I have an existing set of C++ code I am trying to swig. The code is organized like this: // Library A (static library). Has classes in it like so: class ISomeBaseClass { // Blah } class SomeAbstractBaseClass { void SomeAbstractMethod( ISomeBaseClass & obj ) = 0; } // Library B (dynamic library). Has a class in it like so: class SomeDerivedClass : public SomeAbstractBaseClass { void SomeAbstractMethod( ISomeBaseClass & obj ); } I am trying to, in my C# project, create a "SomeDerivedClass" object and assign it to a "SomeAbstractBaseClass" reference, but I'm having problems when trying to swig Library B. I've tried numerous things to get this to work. I've tried creating one swig module, in Library B which swigs SomeDerivedClass, but swig complains that that it knows nothing about SomeAbstractBaseClass or ISomeBaseClass. I made sure I included the path to the file where they are declared in the module declaration and did an %include on that file to get to swig its contents. Also made sure I used the -I command line switches to help it locate the files. I've also tried swigging both libraries (changing the first one from static to dynamic) but that didn't help either. Is there a way I'm supposed to go about achieving this? I've read through the docs w/o any luck. Thanks, Dario |