[pacman-dev] alpm linking

Xavier shiningxc at gmail.com
Mon Sep 3 07:57:53 EDT 2007


On Mon, Sep 03, 2007 at 12:12:05PM +0200, Stefano Esposito wrote:
> Hi all,
> 
> just trying to compile a trivial c++ program which uses alpm. In the linking phase i get those errors:
> 
> alpmm.o: In function `alpm_str_list_to_vector(__alpm_list_t*)':
> alpmm.cc:(.text+0x1b2): undefined reference to `alpm_list_first(__alpm_list_t*)'
> alpmm.cc:(.text+0x1d0): undefined reference to `alpm_list_getdata(__alpm_list_t const*)'
> alpmm.cc:(.text+0x24b): undefined reference to `alpm_list_next(__alpm_list_t*)'
> alpmm.o: In function `Alpmm::set_databases()':
> alpmm.cc:(.text+0x5c2): undefined reference to `alpm_list_getdata(__alpm_list_t const*)'
> alpmm.cc:(.text+0x6fc): undefined reference to `alpm_list_next(__alpm_list_t*)'
> alpmm.o: In function `Alpmm::get_options()':
> alpmm.cc:(.text+0x788): undefined reference to `alpm_option_get_logfile'
> alpmm.cc:(.text+0x79f): undefined reference to `alpm_option_get_usesyslog'
> alpmm.cc:(.text+0x7be): undefined reference to `alpm_option_get_noupgrades'
> alpmm.cc:(.text+0x7f5): undefined reference to `alpm_option_get_noextracts'
> alpmm.cc:(.text+0x84d): undefined reference to `alpm_option_get_ignorepkgs'
> alpmm.cc:(.text+0x8a5): undefined reference to `alpm_option_get_holdpkgs'
> alpmm.cc:(.text+0x8fd): undefined reference to `alpm_option_get_needles'
> database.o: In function `~Database':
> /home/ragnarok/workspace/gtkpacman/branches/c++/src/database.cc:26: undefined reference to `alpm_db_unregister'
> /home/ragnarok/workspace/gtkpacman/branches/c++/src/database.cc:26: undefined reference to `alpm_db_unregister'
> database.o: In function `Database::get_packages()':
> /home/ragnarok/workspace/gtkpacman/branches/c++/src/database.cc:45: undefined reference to `alpm_list_next(__alpm_list_t*)'
> /home/ragnarok/workspace/gtkpacman/branches/c++/src/database.cc:47: undefined reference to `alpm_list_getdata(__alpm_list_t const*)'
> 
> I'm just missing something on alpm linking? I've added only -lalpm to my compiler line
> 

I believe you should use alpm_list_t , not __alpm_list_t .
All other errors seem to be fixed in 3.1 .
I don't know why, but many many functions in pacman 3.0 were not public, and
this has only been fixed in 3.1 .




More information about the pacman-dev mailing list