russdill / tunsocks

User-level IP forwarding, SOCKS proxy, and HTTP proxy for VPNs that provide tun-like interface
321 stars 67 forks source link

Undefined reference to evhttp_response_code_ #15

Open jdoe0000000 opened 4 years ago

jdoe0000000 commented 4 years ago

Compiling tunsocks against libevent-2.1.12 fails with the following error messages:

/usr/bin/ld: src/http/http.o: in function `client_send_error':
/tmp/tunsocks/src/http/http.c:60: undefined reference to `evhttp_response_code_'
/usr/bin/ld: /tmp/tunsocks/src/http/http.c:69: undefined reference to `evhttp_send_page_'
/usr/bin/ld: src/http/http.o: in function `proxy_req_server_headers_done':
/tmp/tunsocks/src/http/http.c:136: undefined reference to `evhttp_response_code_'
russdill commented 4 years ago

These symbols have been part of libevent since 2.1.1.

ghost commented 4 years ago

I have the same issue here (Arch Linux, libevent 2.1.12). I've found that recently Arch stopped providing a static library for libevent (libevent.a), which may explain why the issue is only appearing now. Since these functions are not part of the public API of libevent, they are not exported, and therefore you cannot rely on them being available when linking against the dynamic library (libevent.so). Would it be possible to use public functions instead?