Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

stevieb's scratchpad

by stevieb (Monsignor)
on Aug 19, 2009 at 17:51 UTC ( #789892=scratchpad: print w/replies, xml ) Need Help??

The C program:

#include <stdio.h> #include <wiringPi.h> int main (){ char * ver = wiringPiVersion(); printf("wiringPi version: %s\n", ver); return 0; }

I compile like this:

gcc -o ver wpi_ver.c -lwiringPi

The addition to .h

extern char * wiringPiVersion(void);

The .c addition:

char * wiringPiVersion(void){ return "string"; # actually it's a `#define`, but I digress }

In my module's XS file, I have:

char * wiringPiVersion()

...and my Makefile.PL

LIBS => ['-lwiringPi'],

...and after re-installing the Perl module, I can access the function without any issue.

Log In?

What's my password?
Create A New User
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2017-02-21 00:13 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (304 votes). Check out past polls.