Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Errors using DLL from Inline C with 32-bit Perl

by syphilis (Archbishop)
on Jan 29, 2020 at 22:56 UTC ( [id://11112054]=note: print w/replies, xml ) Need Help??


in reply to Errors using DLL from Inline C with 32-bit Perl

Why is this happening and can it be (easily) fixed?

The only thing I can think of is that the Inline::C script and the C script are finding different files - either the wiz.* files, or the freeimage library.

In building the executable, it was unnecessary to provide info regarding the location of the freeimage library.
Generally that would mean that it's also unnecessary to provide that info to the Inline::C script, so 2 things I would try is to:
1) remove the "inc =>" spec completely and
2) change the "lib =>" spec to simply libs => '-lfreeimage'
That should let the C toolchain find it's own way - just as happened when you built the executable

I think it has to be something pretty simple.
IME, when odd stuff like this happens, it's never because Inline::C is doing something it shouldn't - but, of course, there could always be "a first time" ;-)

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Errors using DLL from Inline C with 32-bit Perl
by vr (Curate) on Jan 31, 2020 at 09:48 UTC
    the Inline::C script and the C script are finding different files

    Spot on! But problem persists. I'm embarrassed to admit ("what else he forgot to mention?"), that I must have placed FreeImage.dll (and *.lib, and *.h) into appropriate "system" GCC folders, when started experiments a couple weeks ago. However, if I either (1) modify Perl script as you suggest, or (2) delete mentioned files and add "-I. -L." to C command line -- the end results are the same. The compiled exe runs OK, Perl crashes.

    just general debugging advice...

    Thanks, bliako! I've already checked that all functions (including "FreeImage_GetFileType") complete successfully for a TIF, and all up to and including "FreeImage_GetTagKey" for a JPG. And compiler flags for *.c file were taken from *.inl, with Perl related defines omitted. Same result if I copy verbatim from "perl -V:ccflags"

    Anonymous Monk: other info, obtained after click-click in said GUI:

    
    Error signature
    AppName: perl.exe	 AppVer: 5.28.0.1	 ModName: freeimage.dll
    ModVer: 3.18.0.0	 Offset: 00066bf0
    
    

    As I said, the problem is not worth too much effort, please don't waste your time. I can only add, there's PDL::IO::Image which uses Alien::FreeImage, which includes FreeImage source (version 3.017), they work successfully on this 32-bit installation (and, yes, I also tried to clean-delete Alien::FreeImage and its compiled library, no changes).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11112054]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found