Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Venerable Monks
I am gluing some components written in C++ under windows platform. I am using SWIG for the same. Being newbie in SWIG I wanted some suggestion from you in the following problem:-

Given class Grand_Father from which Father is publically inherited and again from this son is publically inherited.

Now inorder to call function foo() in Son I wrote interface file like this:-
%module example %import Grand_Father.h %import Father.h %{ #include "son.h" %} %int foo();
When I compiled it i got error- Syntax error input(line_number)... pointing to definitions in Father class which are absolutely correct. Can anyone throw light on this as to where i have gone wrong?

rgds
Thomas

jdporter added <code> tags

Replies are listed 'Best First'.
Re: Error while compiling Swig Interface file
by PodMaster (Abbot) on Dec 14, 2005 at 07:22 UTC
    Can anyone throw light on this as to where i have gone wrong?
    I would say your biggest mistake is that you've chosen SWIG, but I'm biased :) On the other hand, if you want to stick with SWIG, you would greatly help yourself (and anyone trying to help you) by providing an actual error message and actual C++ sourcecode (what swig generates, and Father/son/Grand_Father).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.