phoku
02-09-2003, 18:39
Hallo,
ich hab folgenden Code setpin.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <parapin.h>
main(int argc, char *argv[]) {
int i = atoi(argv[1]);
int n = atoi(argv[2]);
if (pin_init_user(LPT1) < 0)
exit(0);
pin_output_mode(LP_DATA_PINS | LP_SWITCHABLE_PINS);
switch (n) {
case 1:
printf("\n ==> setting pin %d HI\n\n",i );
set_pin(LP_PIN[i]);
break;
case 0:
printf("\n ==> setting pin %d LOW\n\n",i );
clear_pin(LP_PIN[i]);
break;
}
}
beim compilieren mit gcc -o binary -lparapin setpin.c bekomme ich folgende Fehlermeldung:
/tmp/cckEJoqO.o: In function `main':
/tmp/cckEJoqO.o(.text+0x45): undefined reference to `pin_init_user'
/tmp/cckEJoqO.o(.text+0x63): undefined reference to `pin_output_mode'
/tmp/cckEJoqO.o(.text+0x9f): undefined reference to `set_pin'
/tmp/cckEJoqO.o(.text+0xc9): undefined reference to `clear_pin'
collect2: ld returned 1 exit status
die Dateien /usr/local/include/parapin.h und /usr/local/lib/libparapin.a liegen am richtigen Platz.
Weiß jemand, wo der Fehler ist?
ich hab folgenden Code setpin.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <parapin.h>
main(int argc, char *argv[]) {
int i = atoi(argv[1]);
int n = atoi(argv[2]);
if (pin_init_user(LPT1) < 0)
exit(0);
pin_output_mode(LP_DATA_PINS | LP_SWITCHABLE_PINS);
switch (n) {
case 1:
printf("\n ==> setting pin %d HI\n\n",i );
set_pin(LP_PIN[i]);
break;
case 0:
printf("\n ==> setting pin %d LOW\n\n",i );
clear_pin(LP_PIN[i]);
break;
}
}
beim compilieren mit gcc -o binary -lparapin setpin.c bekomme ich folgende Fehlermeldung:
/tmp/cckEJoqO.o: In function `main':
/tmp/cckEJoqO.o(.text+0x45): undefined reference to `pin_init_user'
/tmp/cckEJoqO.o(.text+0x63): undefined reference to `pin_output_mode'
/tmp/cckEJoqO.o(.text+0x9f): undefined reference to `set_pin'
/tmp/cckEJoqO.o(.text+0xc9): undefined reference to `clear_pin'
collect2: ld returned 1 exit status
die Dateien /usr/local/include/parapin.h und /usr/local/lib/libparapin.a liegen am richtigen Platz.
Weiß jemand, wo der Fehler ist?