How do I use the PiFace C Library? - Raspberry Pi Forums
i can't find info on piface or offical website. makes thing?
can find github page.
library files in /usr/local/lib/
include file in /usr/local/includes/libpiface-1.0/
run this. i've been trying thing compile days
there c library can use
can find github page.
library files in /usr/local/lib/
include file in /usr/local/includes/libpiface-1.0/
code: select all
#include <iostream> #include <libpiface-1.0/pfio.h> using namespace std; int main(int argc, char *argv[]) { pfio_init(); pfio_digital_write(0, 1); pfio_deinit(); return 0; }code: select all
g++ -l/usr/local/lib/ -lpiface-1.0 -o blah ./blah.ccode: select all
/tmp/ccnw3zyb.o: in function `main': blah.c:(.text+0x8): undefined reference `pfio_init()' blah.c:(.text+0x14): undefined reference `pfio_digital_write(char, char)' blah.c:(.text+0x18): undefined reference `pfio_deinit()' collect2: ld returned 1 exit status there c library can use
you compiling c++ compiler, library c.
havent told c++ compiler library c.
or!!! other way round ? c++ library source called blah.c , not blah.cpp compiler think c library.
ok.. i'm pretty sure 1 or other....
havent told c++ compiler library c.
code: select all
extern "c" { #include <libpiface-1.0/pfio.h> } ok.. i'm pretty sure 1 or other....
raspberrypi
Comments
Post a Comment