in reply to Re: Inline::C query
in thread Inline::C query

If you want to link an external library and/or use its include files you need to specify these in the use Inline statement:

use Inline ( C => Config => LIBS => '-lyourlib', AUTO_INCLUDE => '#include "yourlib.h";' );
This is discussed in more detail in the Inline::C manpage.

/J\

Replies are listed 'Best First'.
Re^3: Inline::C query
by newbio (Beadle) on Mar 07, 2005 at 08:38 UTC
    use Inline ( C => Config => LIBS => '-lyourlib', AUTO_INCLUDE => '#include "header.h";' ); function1 (NULL);

    Hi, when I try to run the above program I get the error:

    Undefined subroutine &main::function1 called at ..\..\test.pl line 8 .

    1. From the error it appears that the program is not reading the function "function1" from the header file "header1.h" which it should or from the libraries library1.lib/library1.dll (in the current directory). Kindly suggest what mistake I am making.

    2. In the syntax above, is "-lyourlib" a special switch or does it need to be replaced by the actual library name, ie, "library1.lib". Still, when I replace I get the same error as above.

    3. I also have a .dll file but am not sure if and how I need to use it.

    Thanks very much.