Re: Calling External DLL functions in Perl using Inline




<ben.sommer@xxxxxxx>
>
>
> Hi All.
>
> I'm just wondering how this problem resolved for you, Sankaran. I have
> the (almost) exact same problem, though my environment is cygwin+gcc.

Brian McCauley suggested the specific problem to which you allude was the
result of trying to process C++ source code with the compiler in C mode. If
that's so (and I've seen a couple of other posts suggesting the same thing)
then I think the solution would be to either convert the C++ source to C, or
use Inline::CPP.

With gcc, you need to be compiling C++ code with g++, not gcc - so if,
during the installation of Inline::CPP, you're prompted for which compiler
to use, make sure that g++ is specified.

So ..... I guess the advice is for you to use Inline::CPP if the source is
C++. If the source is C and you're still getting those errors, then let us
know.

> The user32.dll example from the Inline docs works flawlessly for me as
> well.

That's C code, so one would expect no problem there.

>Also, for my application, any conceivable permutation of the INC
> or LIBS directives (and windows/cygwin LIB/INC/PATH environment
> variables) always results in this:
>
> Note (probably harmless): No library found for '-lMyLib'
>

Sometimes that warning actually *is* harmless - I see it from time to time,
but I only ever take notice of it whenever 'MyLib' is not found.

If the lib is not being found, have you tried:
LIBS => '-L/full_path/to_MyLib -lMyLib',

If you specify '-lMyLib', will gcc find a file called 'MyLib.a', or will it
find only a file named 'libMyLib.a' ? (I think it will find either, but you
might check on that in case there's a problem there.)

Let us know how you get on with this.

Cheers,
Rob


.



Relevant Pages

  • Re: What is Forth?
    ... It is either or both or neither depending on context. ... There could also be requirements that the compiler fit ... statement that the compiler will compile source code. ... a spec that says an application requires a compiler should also specify ...
    (comp.lang.forth)
  • Visibility attribute
    ... I am new to AIX and I am using the Visual Age for C compiler. ... Is there any way to specify in the source code and on the compiler ...
    (comp.unix.aix)
  • RFC: XCall calling convention...
    ... compiler, although what I have implemented thus far differs from this spec ... Arguments are passed on the stack in right-to-left order, ... This will attempt to specify Signature strings as applied to data types. ... reference to type ...
    (alt.lang.asm)
  • Re: Some newbye questions
    ... Why have I to specify twice the type of the output of a function? ... By far the easiest way to get such an explicit interface is ... on the particular compiler. ... Unless you have huge arrays of logicals or some such thing, ...
    (comp.lang.fortran)
  • Re: Sweeney presentation "The Next Mainstream Language"
    ... Specify int to be more specific than real. ... possibly helped by programmer annotations or checks. ... test just before the access to make the compiler see that the index is ... he included compiler-checked manual region allocation in Cyclone. ...
    (comp.lang.functional)