Ask Your Question

cmake error with source 3.4.2 on (k)ubuntu 20.04

asked 2021-01-02 20:02:45 +0000

richi3161 gravatar image

Hi, I got an cmake error while using the source wireshark-3.4.2.tar.xz - with following output: "cc: error: unrecognized command line option '-Wheader-guard' " Same for '-Wcomma' and '-Wshorten-64-to-32' - something missing, but I have no idea where to look. Any hint for me?

edit retag flag offensive close merge delete


Has anything changed in your environment? The CMake generation step checks that the options work for the compiler that CMake has found, but this is only done the first time a compiler is found.

Try deleting the CMakeCache.txt file from your build directory and running the CMake generation step again.

grahamb gravatar imagegrahamb ( 2021-01-02 20:54:38 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2021-01-14 15:46:28 +0000

richi3161 gravatar image

Running the script showed what was missing - and fixed it!

edit flag offensive delete link more

answered 2021-01-02 22:06:08 +0000

Guy Harris gravatar image

I couldn't reproduce that on Boring Old GNOME Ubuntu 20.04 (updated to the current version, at least according to Software Updater).

If removing the CMakeCache.txt file from the build directory doesn't work, try removing the entire build directory, recreating it, and redoing the build from the beginning.

Note that there is no guarantee that if you do a build in a directory on one platform, and then try to rerun the build on another platform in the same directory, it will work. (E.g., if you have the directory on a file server mounted by multiple machines running different OSes or different versions of the same OS, or if you have a Mac with VMware Fusion and are mounting the build directory, or something above it, on a guest Ubuntu machine using HGFS. "-Wshorten-64-to-32" is an Apple-ism, so if you've done a macOS build in that directory and then tried doing an Ubuntu build in the same directory, that could fail.)

edit flag offensive delete link more


That's the way I do it:

# check wireshark build
apt-cache policy wireshark

# install required dependencies
sudo apt install qttools5-dev qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev build-essential automake autoconf libgtk2.0-dev libglib2.0-dev flex bison libpcap-dev libgcrypt20-dev cmake -y

# get wireshark-source
wget$VER.tar.xz -P /tmp

# extract the source
cd /tmp
tar Jxf wireshark-$VER.tar.xz

# compile
rm -r build
mkdir /tmp/build
cd /tmp/build
cmake /tmp/wireshark-$VER

# make to build the source

# make install
make install
richi3161 gravatar imagerichi3161 ( 2021-01-03 17:29:38 +0000 )edit

...and the last lines from the output:

    CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find CARES (missing: CARES_LIBRARY CARES_INCLUDE_DIR) (Required
  is at least version "1.5.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindCARES.cmake:36 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:1051 (find_package)
richi3161 gravatar imagerichi3161 ( 2021-01-03 17:33:00 +0000 )edit

Error occurs even deleting "build" directory. I think, there is something missing...

richi3161 gravatar imagerichi3161 ( 2021-01-03 17:35:29 +0000 )edit

c-ares is missing from "# install required dependencies". Is it loaded on your system?
You might compare your script to the Debian setup script.

Chuckc gravatar imageChuckc ( 2021-01-03 18:01:38 +0000 )edit

So the issue appears to have changed from unsupported compiler flags to missing a dependency? If so, then that's really a separate question.

grahamb gravatar imagegrahamb ( 2021-01-03 19:54:58 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2021-01-02 20:02:45 +0000

Seen: 2,419 times

Last updated: Jan 14 '21