Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In enum_cards: radeonvolt.c:(.text+0xfa): undefined reference to `pci_alloc' #2

Open
pmalek opened this issue Mar 6, 2014 · 2 comments

Comments

@pmalek
Copy link

pmalek commented Mar 6, 2014

I am trying to compile that on Ubuntu 13.10 ( I see that it has been a while)

rm -f radeonvolt *.o
gcc -O3 -Wall -c radeonvolt.c
gcc -O3 -Wall -c i2c.c
gcc -O3 -Wall -c vt1165.c
gcc -O3 -Wall -lrt -lpci -o radeonvolt radeonvolt.o i2c.o vt1165.o
radeonvolt.o: In function `enum_cards':
radeonvolt.c:(.text+0xfa): undefined reference to `pci_alloc'
radeonvolt.c:(.text+0x104): undefined reference to `pci_init'
radeonvolt.c:(.text+0x10c): undefined reference to `pci_scan_bus'
radeonvolt.c:(.text+0x1a0): undefined reference to `pci_lookup_name'
radeonvolt.c:(.text+0x206): undefined reference to `pci_cleanup'
collect2: error: ld returned 1 exit status
make: *** [radeonvolt] Error 1

having

ii  libpci-dev                           1:3.1.9-6ubuntu9                                      i386         Linux PCI Utilities (development files)
ii  libpci3:i386                         1:3.1.9-6ubuntu9                                      i386         Linux PCI Utilities (shared library)
ii  libpciaccess-dev:i386                0.13.2-1                                              i386         Generic PCI access library for X - development files
ii  libpciaccess0:i386                   0.13.2-1                                              i386         Generic PCI access library for X
ii  pciutils                             1:3.1.9-6ubuntu9                                      i386         Linux PCI Utilities
@eRabbit0
Copy link

For Ubuntu 16.04., changing the order in Makefile helped to resolve the problem, just shift ${LDFLAGS} to the end of the line, like this:
${CC} ${CFLAGS} -o $@ $^ ${LDFLAGS}
The library reference has to be listed after the ".o" file, since the linker/loader processes the arguments in order.

@pmalek
Copy link
Author

pmalek commented May 21, 2017

I cannot verify this solution anymore (I've sold my Radeons 2 years ago ;)) but it seems that it might be work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants