If you got errors below while installing wireshark, brew unlink binutils
may resolves it.
env HOMEBREW_MAKE_JOBS=1 brew install -d -v --keep-tmp wireshark
Ignoring debase-0.2.2.beta8 because its extensions are not built. Try: gem pristine debase --version 0.2.2.beta8
Ignoring debase-0.2.2.beta8 because its extensions are not built. Try: gem pristine debase --version 0.2.2.beta8
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/wireshark.rb
==> Upgrading 1 outdated package:
wireshark 2.6.4 -> 2.6.5
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/cmake.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/sphinx-doc.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/c-ares.rb
...
[ 6%] Linking C executable run/Wireshark.app/Contents/MacOS/extcap/randpktdump
/usr/local/Cellar/cmake/3.13.2/bin/cmake -E cmake_link_script CMakeFiles/randpktdump.dir/link.txt --verbose=1
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -fvisibility=hidden -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wheader-guard -Wframe-larger-than=32768 -Wc++-compat -Wunused-const-variable -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Wshorten-64-to-32 -Werror=implicit -Wcomma -Qunused-arguments -std=gnu99 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-headerpad_max_install_names -Wl,-search_paths_first -pie CMakeFiles/randpktdump.dir/extcap/extcap-base.c.o CMakeFiles/randpktdump.dir/extcap/randpktdump.c.o -o run/Wireshark.app/Contents/MacOS/extcap/randpktdump -L/usr/local/Cellar/glib/2.58.2/lib -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/ui -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/ui/gtk -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/ui/qt -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/capchild -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/caputils -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/codecs -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/epan -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/randpkt_core -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/wiretap -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/writecap -L/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/wsutil -Wl,-rpath,/usr/local/Cellar/glib/2.58.2/lib -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/ui -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/ui/gtk -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/ui/qt -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/capchild -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/caputils -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/codecs -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/epan -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/randpkt_core -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/wiretap -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/writecap -Wl,-rpath,/tmp/wireshark-20181225-52262-1kitmox/wireshark-2.6.5/wsutil run/librandpkt_core.a run/libui.a run/Wireshark.app/Contents/Frameworks/libwiretap.8.0.5.dylib /usr/local/lib/libglib-2.0.dylib /usr/lib/libz.dylib run/Wireshark.app/Contents/Frameworks/libwsutil.9.0.0.dylib -framework CoreFoundation /usr/local/lib/libglib-2.0.dylib -lgmodule-2.0 -lglib-2.0 -lintl /usr/local/lib/libgcrypt.dylib /usr/local/lib/libgpg-error.dylib /usr/lib/libz.dylib /usr/local/lib/libgnutls.dylib
Undefined symbols for architecture x86_64:
"_randpkt_example_close", referenced from:
_main in randpktdump.c.o
"_randpkt_example_init", referenced from:
_main in randpktdump.c.o
"_randpkt_example_list", referenced from:
_main in randpktdump.c.o
_help in randpktdump.c.o
"_randpkt_find_example", referenced from:
_main in randpktdump.c.o
"_randpkt_loop", referenced from:
_main in randpktdump.c.o
"_randpkt_parse_type", referenced from:
_main in randpktdump.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [run/Wireshark.app/Contents/MacOS/extcap/randpktdump] Error 1
make[1]: *** [CMakeFiles/randpktdump.dir/all] Error 2
make: *** [all] Error 2
or, without HOMEBREW_MAKE_JOBS=1
,
writecap -Wl,-rpath,/tmp/wireshark-20181225-11618-18zfdw3/wireshark-2.6.5/wsutil run/libwritecap.a run/Wireshark.app/Contents/Frameworks/libwsutil.9.0.0.dylib /usr/local/lib/libglib-2.0.dylib /usr/local/lib/libssh.dylib -framework CoreFoundation -lgmodule-2.0 -lglib-2.0 -lintl /usr/local/lib/libglib-2.0.dylib /usr/local/lib/libgcrypt.dylib /usr/local/lib/libgpg-error.dylib /usr/lib/libz.dylib /usr/local/lib/libgnutls.dylib
[ 17%] Building C object CMakeFiles/sshdump.dir/extcap/extcap-base.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DTOP_SRCDIR=\"/tmp/wireshark-20181225-11618-18zfdw3/wireshark-2.6.5\" -I/tmp/wireshark-20181225-11618-18zfdw3/wireshark-2.6.5 -isystem /usr/local/opt/gettext/include -isystem /usr/local/opt/c-ares/include -isystem /usr/local/opt/libgcrypt/include -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/Cellar/pcre/8.42/include -isystem /usr/local/Cellar/glib/2.58.2/include/glib-2.0 -isystem /usr/local/Cellar/glib/2.58.2/lib/glib-2.0/include -isystem /usr/local/opt/gnutls/include -isystem /usr/local/include -isystem /usr/local/opt/[email protected]/include/lua-5.1 -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -iframework /usr/local/opt/qt/lib -isystem /usr/local/opt/qt/lib/QtCore.framework/Headers -isystem /usr/local/opt/qt/./mkspecs/macx-clang -isystem /usr/local/opt/qt/lib/QtMacExtras.framework/Headers -isystem /usr/local/opt/qt/lib/QtGui.framework/Headers -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -isystem /usr/local/opt/qt/lib/QtMultimedia.framework/Headers -isystem /usr/local/opt/qt/lib/QtNetwork.framework/Headers -isystem /usr/local/opt/qt/lib/QtPrintSupport.framework/Headers -isystem /usr/local/opt/qt/lib/QtWidgets.framework/Headers -isystem /usr/local/opt/qt/lib/QtSvg.framework/Headers -fvisibility=hidden -Wall -Wextra -Wendif-labels -Wpointer-arith -Wformat-security -fwrapv -fno-strict-overflow -Wvla -Waddress -Wattributes -Wdiv-by-zero -Wignored-qualifiers -Wpragmas -Wno-overlength-strings -Wno-long-long -Wheader-guard -Wframe-larger-than=32768 -Wc++-compat -Wunused-const-variable -Wshadow -Wno-pointer-sign -Wold-style-definition -Wstrict-prototypes -Wlogical-op -Wjump-misses-init -Wshorten-64-to-32 -Werror=implicit -Wcomma -Qunused-arguments -std=gnu99 -DNDEBUG -fPIE -o CMakeFiles/sshdump.dir/extcap/extcap-base.c.o -c /tmp/wireshark-20181225-11618-18zfdw3/wireshark-2.6.5/extcap/extcap-base.c
Undefined symbols for architecture x86_64:
"_libpcap_write_file_header", referenced from:
_main in ciscodump.c.o
"_libpcap_write_packet", referenced from:
_main in ciscodump.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [run/Wireshark.app/Contents/MacOS/extcap/ciscodump] Error 1
make[1]: *** [CMakeFiles/ciscodump.dir/all] Error 2
make[1]: *** Waiting for unfinished j
Going into shell and do /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang ...
, I got an error like:
ld: warning: ignoring file run/librandpkt_core.a, file was built for archive which is not the architecture being linked (x86_64)
After googling file was built for archive which is not the architecture being linked (x86_64)
, I found out that it comes from GNU binutils installed via Homebrew.