Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Gcc compiler version for redhat for Wireshark 2.9.0

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 7 Dec 2018 10:23:45 -0800
On Dec 6, 2018, at 2:00 PM, Jeff Peng <jeff2008_bj@xxxxxxxxxxx> wrote:

> I tried to compile Wireshark 2.9.0 for redhat os (CentOS Linux release 7.2.1511), but failed. My current gcc version is 4.8.5. Do you know which gcc comipler version is expected for Wireshark 2.9.0 on RedHat?
> 
> $ cc --version
> cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
> Copyright (C) 2015 Free Software Foundation, Inc.
> 
> $ /usr/bin/cmake3 ../wireshark-2.9.0rc0-2747-g56b255dc
> …….
> -- Configuring incomplete, errors occurred!
> See also "xxx/build/CMakeFiles/CMakeOutput.log".
> See also "xxx/build/CMakeFiles/CMakeError.log".
> 
> CMakeError.log:
>   9 cc: error: unrecognized command line option '-Wextra-semi'
> 24 cc: error: unrecognized command line option '-Wheader-guard'
> 39 cc: error: unrecognized command line option '-Wcomma'
> 54 cc: error: unrecognized command line option '-Wshorten-64-to-32'
> 69 cc: error: unrecognized command line option '-Wunused-const-variable'
> 84 c++: error: unrecognized command line option '-Wextra-semi'
> 99 c++: error: unrecognized command line option '-Wheader-guard'
> 114 c++: error: unrecognized command line option '-Wcomma'
> 129 c++: error: unrecognized command line option '-Wshorten-64-to-32'

Those aren't build errors - we test whether those flags are supported by the compiler, and use them only if they are.

> 145 /users/pen55339/xs/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:19: error: ‘heimdal_version’ undeclared (first use in this function)
> 187 collect2: error: ld returned 1 exit status

Ditto - we test whether you appear to have Heimdal Kerberos and, if so, use it.  We also test for MIT Kerberos, and use that if it's available (if both are installed, which is chosen depends on the order in which we test them); if neither are available, we don't use either (which means some stuff can't be dissected).

> wireshark-2.9.0 $ grep -i gcc CMakeLists.txt
>         # In addition, CMake 3.5.2 seems to think that GCC versions
>                 # some older compilers such as GCC 4.4.7, -std=gnu99
>                 # Some versions of GCC, such as 4.3.2 and 4.4.5,
>                         # Works only with GCC 7
>         # Available since Clang >= 3.2 and GCC >= 4.8
>         # Available since Clang >= 3.3 and GCC >= 4.9
>                 # no way, in Apple's llvm-gcc, to prevent that
>         # Try the GCC-and-compatible -fvisibility-hidden first.
> 
> Does it mean that I should use gcc 7 and above version?

No, it means you should show us the actual configuration *errors*, so we know what's going wrong.  Show the output of CMake, *not* the contents of CMakeError.log.