Compiling My Traceroute (MTR) on Mac OS X Mountain Lion

My Traceroute (MTR) is a very nice tool to get an impression of your network neighborhood. When trying to compile the most recent version of the tool (mtr-0.82) on my Mac (OS X 10.8.1) i ran into this problem:

gcc -g -O2 -Wall -Wno-pointer-sign curses.o -o mtr mtr.o net.o dns.o raw.o split.o display.o report.o getopt.o getopt1.o select.o -lm -ltermcap
Undefined symbols for architecture x86_64:
 "_res_9_dn_expand", referenced from:
 _parserespacket in dns.o
 "_res_9_ninit", referenced from:
 _dns_open in dns.o
 "_res_9_nmkquery", referenced from:
 _dorequest in dns.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [mtr] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Turns out its missing libresolv. The solution is simple:

Europa:mtr-0.82 justusbeyer$ export LDFLAGS="-lresolv"
Europa:mtr-0.82 justusbeyer$ ./configure --prefix=/usr --without-gtk
<lots of configure output> 
Europa:mtr-0.82 justusbeyer$ make

 

3 thoughts on “Compiling My Traceroute (MTR) on Mac OS X Mountain Lion

  1. I am not a programmer and I have no possibility to compile MTR.
    I could not find a ready-made MTR for MacOs X 10.8.2 .
    Can you send me a compiled under 10.8 (ML) MTR utility?
    Thank you very much!

  2. Hallo,
    Sorry for my english….
    I can’t compile mtr for mac osx 10.8.2.
    Can you send me a compiled under 10.8 (ML) MTR utility?

    Thanks

Leave a Reply

Your email address will not be published.