You haven't specified your environment.
Linux? Cygwin? Other?
If Cygwin, have you installed the ioperm.sys driver?
If Linux, have you read the man pages, saying typically:
"You compile with -O or -O2 or similar. The functions are
defined as inline macros, and will not be substituted
in without optimization enabled, causing unresolved
references at link time."
Always make sure that you supply _ample_ information when asking
questions, since the people who you want to answer your question only have
the information in your mail. We can't guess what extra information you
have left out.
/pwm
On Mon, 21 Jul 2008, frederico schardong wrote:
> please see this:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <conio.h>
> #include <asm/io.h>
> #include <unistd.h>
>
> #define LPT1 0x378
>
> int libera_porta(){
> if(ioperm(LPT1,3,1)==1)//libera acesso para os endereços
> 0x378,0x379,0x37A
> return(1);
> else
> return(0);
> }
>
> fecha_porta(){
> ioperm(LPT1,3,0);
> }
>
> main(){
> if(libera_porta() == 1)
> printf("\nPorta liberada com sucesso\n");
>
> else
> printf("\nPorta nao liberada\n");
>
> //outb(255,LPT1);
>
> fecha_porta();
>
> }
>
>
> I was execute on root, but never get permission to use the lpt, and when
> outb is not reviewed I recive this error: (.text+0x101): undefined reference
> to '__outb'.
> tanks
>
|