#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "parapin.h"
int main(int argc, char *argv[])
{
int i;
if (pin_init_user(LPT1) < 0)
exit(0);
pin_input_mode(LP_DATA_PINS);
pin_input_mode(LP_SWITCHABLE_PINS);
printf("\ninit...\n");
for (i = 1; i <= 17; i++)
printf("Setting pin %d as %s\n", i, pin_is_set(LP_PIN[i]) ? "HIGH":"LOW");
printf("\n\n");
return 0;
}
I try to compile this with
g++ inputtest.c
and I get the following output:
[root@localhost examples]# g++ inputtest.c
/tmp/ccGjp3wX.o: In function `main':
inputtest.c:(.text+0x19): undefined reference to `pin_init_user'
inputtest.c:(.text+0x38): undefined reference to `pin_input_mode'
inputtest.c:(.text+0x44): undefined reference to `pin_input_mode'
inputtest.c:(.text+0x6f): undefined reference to `pin_is_set'
inputtest.c:(.text+0xe1): undefined reference to `pin_is_set'
inputtest.c:(.text+0x14c): undefined reference to `pin_is_set'
collect2: ld returned 1 exit status