LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-02-2010, 06:29 AM   #1
cvr
LQ Newbie
 
Registered: Jun 2010
Posts: 18

Rep: Reputation: 0
Smile Help me to resolve these errors when I use outb ,inb in linux


Hello frns,
I have written the code about the buzzer..
When I am compiling code which consists of outb and inb instructions,
I am getting the errors as below
buzz_sep2.c.text+0x19): undefined reference to `outb'
buzz_sep2.c.text+0x2d): undefined reference to `outb'
buzz_sep2.c.text+0x41): undefined reference to `outb'
buzz_sep2.c.text+0x4d): undefined reference to `inb'
buzz_sep2.c.text+0x60): undefined reference to `outb'
buzz_sep2.c.text+0x78): undefined reference to `inb'

How to solve these errors.?
I have added header files <sys/types.h>
<if_ddi.h>
Please tell me how to solve these errors.
Thanks in advance
 
Old 09-02-2010, 11:52 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by cvr View Post
Hello frns,
I have written the code about the buzzer..
When I am compiling code which consists of outb and inb instructions,
I am getting the errors as below
buzz_sep2.c.text+0x19): undefined reference to `outb'
buzz_sep2.c.text+0x2d): undefined reference to `outb'
buzz_sep2.c.text+0x41): undefined reference to `outb'
buzz_sep2.c.text+0x4d): undefined reference to `inb'
buzz_sep2.c.text+0x60): undefined reference to `outb'
buzz_sep2.c.text+0x78): undefined reference to `inb'

How to solve these errors.?
I have added header files <sys/types.h>
<if_ddi.h>
Please tell me how to solve these errors.
Thanks in advance
Spell your words out. And your question makes little sense to us here, and lacks details.

What "code about the buzzer"??? What do you mean? What are you trying to do, on what version/distro of Linux, with what hardware?? Short answer to this question is "You wrote the code...you need to fix it".
 
Old 09-03-2010, 07:49 AM   #3
cvr
LQ Newbie
 
Registered: Jun 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Buzzer

Last edited by cvr; 09-06-2010 at 02:11 AM. Reason: '
 
Old 09-07-2010, 05:38 AM   #4
linux_hy
Member
 
Registered: Oct 2006
Posts: 66

Rep: Reputation: -2
did you include the <sys/io.h> and <unistd.h> ?
the manual page said following
"these systemcalls are primarily designed for internel kernel use,but can be used from user space.you compile with -O or -O2 similar.the functions are defined as inline macros,and will not substituted in without optimization enabled,causing unresolved references at link time" please "man outb" for more detailed
and your error at link error,try to adjust your options of compiler when you compiling
my testing code I compiled it with gcc test.c and no error occured. so try to check your options of compiler
#test.c
#include <stdio.h>
#include <unistd.h>
#include <sys/io.h>
int main()
{
outb(1,1);
return 0;
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing on keyboard port via inb(), outb() system calls ankur0921 Programming 2 04-06-2010 12:30 AM
How do I resolve errors reported by make? qlue Linux - Software 6 08-18-2009 04:46 AM
different ports for use in inb, outb prashmohan Programming 0 11-23-2004 12:39 AM
inb,outb macro help prashmohan Programming 2 11-22-2004 12:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration