LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 10-12-2009, 12:44 AM   #1
shakeela
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
undefined reference to pci_find_device


i am using rtlinux 2.6.24.4 and compiling using gcc 4.1
my code is
#include <linux/pci>
#include <stdio.h>
#define DWORD unsigned int
static struct pci_dev *gDev;
static DWORD dwBaseAddress,dwDataAddress,dwTimerAddress;
int main()
{
gDev=NULL;
gDev=pci_find_device(VENDOR_ID,DEVICE_ID,gDev);
if(gDev==NULL)
{
printf("BOARDNOTFOUND");
return(0);
}
return(1);
}


error is:
/tmp/ccKFDcUi.o:
undefined reference to pci_find_device
collect2: ld returned 1 exit status

Last edited by shakeela; 10-12-2009 at 06:16 AM.
 
Old 10-12-2009, 01:40 AM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by shakeela View Post
i am using rtlinux 2.6.24.4 and compiling using gcc 4.1
my code is
#include <linux/pci>
#include <stdio.h>
#define DWORD unsigned int
static struct pci_dev *gDev;
static DWORD dwBaseAddress,dwDataAddress,dwTimerAddress;
int main()
{
gDev=NULL;
gDev=pci_find_device(VENDOR_ID,DEVICE_ID,gDev);
if(gDev==NULL)
{
printf("BOARDNOTFOUND");
return(0);
}
return(1);
}


error is:
undefined reference to pci_find_device
collect2: ld returned 1 exit status
Well, clearly the function name you are using is not declared in the header files you have provided. Why not look into the source that tells you this function exists, and what header provides its declaration?
 
Old 10-24-2009, 04:10 PM   #3
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

The thread with most answers is: http://www.linuxquestions.org/questi...6.24.4-763088/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
undefined reference to pci_find_device shakeela Linux - Newbie 2 10-24-2009 04:08 PM
undefined reference to... dimah Programming 3 12-27-2006 10:57 AM
undefined reference? Sharky01252 Programming 3 11-07-2006 12:36 PM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 04:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 01:38 PM


All times are GMT -5. The time now is 10:13 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration