murrayn has asked for the wisdom of the Perl Monks concerning the following question:
The full Perl script is short:use Inline C => Config => AUTO_WRAP => ENABLE; use Inline C => Config => LIBS => '-L"C:\Program Files\Common Files\Pr +oduct\4.1\dptcpiphi.dll" -ldptcpip';
The gcc compile step appears to complete successfully but when it comes time to link the object libraries together it fails:#!/usr/bin/perl -w use Inline C => Config => AUTO_WRAP => ENABLE; use Inline C => Config => LIBS => '-L"C:\Program Files\Common Files\Pr +oduct\4.1\dptcpiphi.dll" -ldptcpip'; use Inline C => DATA ; use strict; my $DPbuff = "statusbuffer"; my $status = MyGetCtrlStatus('0x14','localhost','1703',$DPbuff); print "$status\n"; __END__ __C__ int MyGetCtrlStatus(char ShiftCmd, char pHostName, char uPortNum, char + pCtrlStatus) { char JobInfo; int status = DPGetCtrlStatus(ShiftCmd, pHostName, uPortNum, pCtrlS +tatus); printf ("Running...\n"); return pHostName; }
(I know the code isn't going to work at present but I can fix that as long as I can get Inline::C to link the vendor libraries into my Perl script.) Have I completely misinterpreted the purpose and capabilities of Include::C or simply made a mess of using the tool?Test_pl_5261.o:Test_pl_5261.c:(.text+0x27): undefined reference to `DP +GetCtrlStatus' collect2: ld returned 1 exit status dmake.exe: Error code 129, while making 'blib\arch\auto\Test_pl_5261\ +Test_pl_5261.dll'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Understanding Inline::C to call vendor libraries
by syphilis (Archbishop) on Jul 25, 2014 at 13:08 UTC | |
by murrayn (Sexton) on Jul 28, 2014 at 07:08 UTC | |
by syphilis (Archbishop) on Jul 28, 2014 at 08:03 UTC | |
by murrayn (Sexton) on Aug 04, 2014 at 23:57 UTC | |
|
Re: Understanding Inline::C to call vendor libraries
by Anonymous Monk on Jul 25, 2014 at 07:45 UTC |