🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Geir Mon, 31 Jul 2000 00:00
gcc-newbie question...
#1
Author: Geir
Date: Mon, 31 Jul 2000 00:00
44 lines
1950 bytes
I have just started to try out a little C-programming under Linux and I
am playing around with some small programs just to "try things out". I
wrote the following program which simply is supposed to displays a
message if there is a PCI-bios presenet in the machine;


#include <linux/pci.h>

int main(){
    if (pcibios_present()) printf("PCI-bios found...");
}


int pcibios_present(void) is defined in pci.h...
I then try to compile the program with:

gcc -D__KERNEL__ testpci.c

testpci.c is of course the name of the program and __KERNEL__ needs to
be defined when including "pci.h" to get everything included.
But when I try compiling I get an error-message from ld (the linker),
saying:

undefined reference to 'pcibios_present'

I suppose this means the linker cant find the "pci.o"-object file or
something, and therefore is unable to link in 'pcibios_present()'.

How should I compile this program to make it work?
What am I doing wrong?

All the libraries should be installed in their "standard" places as I am

just using a freshly installed Linux distribution from SuSE.

Hope somebody can help me out...


Geir.




Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads