Hi Monks
I am fairly new to Perl. For gluing my C++ components I decided to use SWIG. After reading the document and examples of using SWIG, I still have following doubts.
1) What exactly have to be included in %{ %} block? In some examples header files and some function declarations were made.But function was again declared outside the block as the one shown like function foo()
%module mymodule
%{
#include file.h
int foo();
%}
int foo();
int bar();
Why is this double declaration of function foo()?
2) Some functions are only declared outside the block like the function bar(). What is the difference in declaring inside and outside the bloack?
3) What is difference between %include and %import.
Kindly enlighten me
Thanking you all in advance
Regards,
Ashu
Edit: g0n - added code tags
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.