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

Hi,

i am new to perl. all i wanna know is how do i redirect output of

 swig -c++ perl5 abc_interface.i

guess i need to use -o option. The generated abc_interface_wrap.cxx file need to be in a particular path of my choice. Pls help.

Replies are listed 'Best First'.
Re: Redirecting swig output
by syphilis (Archbishop) on Feb 19, 2010 at 07:18 UTC
    guess i need to use -o option

    Seems likely. In swig -help I found:
    -o <outfile> - Set name of the output file to <outfile>
    So I think something like the following should work:
    swig -c++ perl5 -o /full/path_to/abc_interface_wrap.cxx abc_interface.i

    It might be that the output filename really does need to be placed inside angle brackets as shown. I don't know.

    Cheers,
    Rob

      I tried this.

      It says

      swig -c++ -perl5 -o obj/vip2vera_interface vip2vera_interface.i No module name specified using %module or -module.
      Also tried inserting between < > . It didnt work either!
        It didnt work either!

        Sorry - I know buggerall (less, in fact) about swig. (Surely there's a swig help list out there ?)
        Seems like it wants you to specify a module name, so try that and see what happens:

        swig -c++ -perl5 -module MyMod -o obj/vip2vera_interface vip2vera_interface.i

        Cheers,
        Rob