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

Re^3: Using Inline::C in a package

by xiaoyafeng (Deacon)
on Sep 05, 2013 at 09:27 UTC ( [id://1052523]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using Inline::C in a package
in thread Using Inline::C in a package

Hi, rem45acp,

I suggest you use InlineX::C2XS to get the task done with out any annoyance. first: create a test.pl like below:

use strict; use Inline C => Config => LIBS => "-LE:/drivers/usb/devasys_i2cio -lusbi2cio", INC => "-IE:/drivers/usb/devasys_i2cio", BUILD_NOISY => 1; use Inline C => q { #include <windows.h> #include "Usbi2cio.h" #include <stdio.h> void OpenDevice() { HANDLE handle = INVALID_HANDLE_VALUE; handle = DAPI_OpenDeviceInstance("UsbI2cIo", 0); if (handle == INVALID_HANDLE_VALUE) { printf("Could not open device\n"); } else { printf("Opened device!\n"); } } };
then run: c2xs ....... it will produce a XS package for you. Please refer Inline::C2XS doc for details.




I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found