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

compile issues on ubuntu 12.04? #1

Open
job opened this issue Mar 13, 2013 · 1 comment
Open

compile issues on ubuntu 12.04? #1

job opened this issue Mar 13, 2013 · 1 comment

Comments

@job
Copy link

job commented Mar 13, 2013

I'm trying to compile cannedbgp against libbgpdump-1.4.99.13 on a standard Ubuntu 12.04 LTS install, but I am getting these errors, are there some extra libraries I need to included?

root@test-03:/source/cannedbgp# make
gcc -g -o cannedbgp pkg-config --libs "libevent" -L../bgpdump -Wl,-rpath,../bgpdump -lbgpdump -lrt main.o
main.o: In function peer_ev_read': /home/test/source/cannedbgp/main.c:133: undefined reference tobufferevent_get_input'
/home/test/source/cannedbgp/main.c:134: undefined reference to evbuffer_get_length' /home/test/source/cannedbgp/main.c:137: undefined reference toevbuffer_drain'
main.o: In function peer_put_message': /home/test/source/cannedbgp/main.c:146: undefined reference tobufferevent_write'
/home/test/source/cannedbgp/main.c:148: undefined reference to evbuffer_get_length' /home/test/source/cannedbgp/main.c:149: undefined reference tobufferevent_write'
/home/test/source/cannedbgp/main.c:151: undefined reference to bufferevent_write_buffer' main.o: In functionpeer_ev_write':
/home/test/source/cannedbgp/main.c:157: undefined reference to evbuffer_new' /home/test/source/cannedbgp/main.c:166: undefined reference tobufferevent_disable'
/home/test/source/cannedbgp/main.c:170: undefined reference to evbuffer_add' /home/test/source/cannedbgp/main.c:171: undefined reference toevbuffer_add'
/home/test/source/cannedbgp/main.c:173: undefined reference to evbuffer_add' /home/test/source/cannedbgp/main.c:174: undefined reference toevbuffer_add'
/home/test/source/cannedbgp/main.c:178: undefined reference to evbuffer_add' main.o:/home/test/source/cannedbgp/main.c:179: more undefined references toevbuffer_add' follow
main.o: In function peer_ev_write': /home/test/source/cannedbgp/main.c:188: undefined reference toevbuffer_free'
/home/test/source/cannedbgp/main.c:192: undefined reference to clock_gettime' main.o: In functionpeer_send_open':
/home/test/source/cannedbgp/main.c:216: undefined reference to evbuffer_new' /home/test/source/cannedbgp/main.c:228: undefined reference toevbuffer_add'
/home/test/source/cannedbgp/main.c:233: undefined reference to evbuffer_add' /home/test/source/cannedbgp/main.c:234: undefined reference toevbuffer_add'
/home/test/source/cannedbgp/main.c:235: undefined reference to evbuffer_add' /home/test/source/cannedbgp/main.c:236: undefined reference toevbuffer_add'
main.o:/home/test/source/cannedbgp/main.c:237: more undefined references to evbuffer_add' follow main.o: In functionpeer_send_open':
/home/test/source/cannedbgp/main.c:240: undefined reference to evbuffer_free' main.o: In functionpeer_send_keepalive':
/home/test/source/cannedbgp/main.c:245: undefined reference to evbuffer_new' /home/test/source/cannedbgp/main.c:248: undefined reference toevbuffer_add'
/home/test/source/cannedbgp/main.c:250: undefined reference to bufferevent_enable' /home/test/source/cannedbgp/main.c:251: undefined reference toevbuffer_free'
main.o: In function peer_ev_other': /home/test/source/cannedbgp/main.c:279: undefined reference tobufferevent_free'
main.o: In function evt_info_tick': /home/test/source/cannedbgp/main.c:312: undefined reference toclock_gettime'
main.o: In function main': /home/test/source/cannedbgp/main.c:444: undefined reference tobgpdump_open_dump'
/home/test/source/cannedbgp/main.c:450: undefined reference to bgpdump_read_next' /home/test/source/cannedbgp/main.c:451: undefined reference totable_dump_v2_peer_index_table'
/home/test/source/cannedbgp/main.c:452: undefined reference to table_dump_v2_peer_index_table' /home/test/source/cannedbgp/main.c:456: undefined reference totable_dump_v2_peer_index_table'
/home/test/source/cannedbgp/main.c:457: undefined reference to table_dump_v2_peer_index_table' /home/test/source/cannedbgp/main.c:500: undefined reference totable_dump_v2_peer_index_table'
main.o:/home/test/source/cannedbgp/main.c:504: more undefined references to table_dump_v2_peer_index_table' follow main.o: In functionmain':
/home/test/source/cannedbgp/main.c:553: undefined reference to bgpdump_read_next' /home/test/source/cannedbgp/main.c:556: undefined reference tobgpdump_free_mem'
/home/test/source/cannedbgp/main.c:568: undefined reference to bgpdump_close_dump' /home/test/source/cannedbgp/main.c:570: undefined reference toevent_base_new'
/home/test/source/cannedbgp/main.c:582: undefined reference to bufferevent_socket_new' /home/test/source/cannedbgp/main.c:583: undefined reference tobufferevent_setcb'
/home/test/source/cannedbgp/main.c:584: undefined reference to bufferevent_setwatermark' /home/test/source/cannedbgp/main.c:585: undefined reference tobufferevent_setwatermark'
/home/test/source/cannedbgp/main.c:586: undefined reference to bufferevent_enable' /home/test/source/cannedbgp/main.c:591: undefined reference toevent_new'
/home/test/source/cannedbgp/main.c:594: undefined reference to event_add' /home/test/source/cannedbgp/main.c:596: undefined reference toevent_new'
/home/test/source/cannedbgp/main.c:599: undefined reference to event_add' /home/test/source/cannedbgp/main.c:601: undefined reference toclock_gettime'
/home/test/source/cannedbgp/main.c:605: undefined reference to `event_base_loop'
collect2: ld returned 1 exit status
make: *** [cannedbgp] Error 1
root@test-03:
/source/cannedbgp#

@eqvinox
Copy link
Contributor

eqvinox commented Mar 14, 2013

On Wed, Mar 13, 2013 at 12:53:10PM -0700, Job Snijders wrote:

I'm trying to compile cannedbgp against libbgpdump-1.4.99.13 on a standard Ubuntu 12.04 LTS install, but I am getting these errors, are there some extra libraries I need to included?

Looks like all symbols from all libraries are missing. This is
probably due to...

root@test-03:~/source/cannedbgp# make
gcc -g -o cannedbgp pkg-config --libs "libevent" -L../bgpdump -Wl,-rpath,../bgpdump -lbgpdump -lrt main.o
main.o: In function `peer_ev_read':

... Ubuntu using a recent linker with --as-needed, which makes ordering
of the libraries relevant. In the Makefile, try moving "main.o" up
front (directly after "-o cannedbgp".

-David

P.S.: This tool was written for internal testing purposes and is
provided as-is. It may blow up your PC, eat your cat, inject bogus
routes into the DFZ, ...

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