« Return to Thread: Most trivial example - failure

Re: Most trivial example - failure

by wsfulton :: Rate this Message:

Reply to Author | View in Thread

David Piepgrass wrote:
>> >From the very beginning I am confused.
>>
>> What is a module ?  Why is the %module declaration needed ?  What is it
>> telling swig to do ?
>
I have added a bit more about this to the docs for the next version, but
in the old docs, it is covered here:

http://www.swig.org/Doc1.3/Java.html#module_packages_classes and it
applies equally to C#.

> I have only used SWIG-C#. In SWIG-C# the module name is the name of the static class that contains wrappers of all global functions and variables. Also, if you use more than one module, each one needs a different name.
>
>> Why am I hash-including and percent-including the same file ?
>> If I hash-include, surely swig now knows about the class, why would I
>> need to tell it again ?
>
> I agree, this is poorly explained. SWIG follows %include directives but it ignores #include directives. %{ ... %} blocks are inserted verbatim into the .cxx wrapper file, but they are otherwise ignored by SWIG.
>
Actually the beginning of the basics chapter describes this, in
particular http://www.swig.org/Doc1.3/SWIG.html#SWIG_nn6 mentions that
#include is not followed and why. It is also mentioned here:
http://www.swig.org/Doc1.3/Preprocessor.html#Preprocessor_nn2.

>> Where is the definitive list of swig reserved words and their meanings ?
>> This does not seem to appear anywhere in any documentation I can find on
>> swig.
>
> All SWIG-specific reserved words start with %... the ones that I can think of are
There is no single list, they are documented throughout. As David
mentioned all the SWIG directives begin with %, so just don't use
anything starting with % if you are thinking of defining any macros. I
suggest the C approach of using capital letters for any macro names with
some unique prefix.

William

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: Most trivial example - failure