Search code examples
ccompilationtorlibevent

compile tor on centos6. Problems with libevent


i have clean centos6 system, try to compile tor from sources. 1st way (installing libevent by yum). I do:

yum install libevent2
yum install libevent2-devel

...

(inside tor folder): ./configure
make

and get error:

src/common/libor-event.a(compat_libevent.o): In function `tor_gettimeofday_cache_clear':
/root/tor-0.3.1.7/src/common/compat_libevent.c:250: undefined reference to `event_base_update_cache_time'
collect2: ld returned 1 exit status
make[1]: *** [src/or/tor] Error 1
make[1]: Leaving directory `/root/tor-0.3.1.7'
make: *** [all] Error 2

2nd way (installing libevent from sources).

yum remove libevent2
yum remove libevent2-devel
..
(from libevent folder): ./configure
make
make install
..
(from tor folder): ./configure

and get error:

checking whether we need extra options to link libevent... configure: error: Found linkable libevent in (system), but it does not seem to run, even with -R. Maybe specify another using --with-libevent-dir}

So, what am i doing wrong?) what to do next?


Solution

  • It is possible that you missed to add the libevent library to library options

    LDFLAGS+=-L[path of the libevent.so] -levent
    

    What is the output of the make?