Ask Your Question

build errors. First time cmake user

asked 2018-02-16 14:35:29 +0000 gravatar image

updated 2018-05-03 21:09:32 +0000

I just downloaded the wireshark source code master V2_4 and did a build with Cmake and got 1206 errors and 600 warnings. This is the base code and I haven't modified any source code to it yet. scanning through the errors, they appeared to be undefined, syntax errors, missing parameters for function calls, etc...

I've been using version 1.12 with nmake for the past several years and thought of upgrading to v24. I created a new directory for version 24, so it should not be sharing the libraries. This is the first time using cmake and I am still using visual studio 10 version which I already have downloaded for the older version. Please suggest. thank you

edit retag flag offensive close merge delete


I have more questions, after building successfully the baseline code wireshark version 2.6 (64bit) and I added a custom dissector in /plugins directory. It built successfully if I did not change the CMakeListsCustom.txt per section 9.2 direction. But did not see the new custom dll in /run/RelWithDebInfo/plugins/2.6. I was expecting the new dll to be there. If I made changes to CMakeListsCustom.txt and added the path to the new custom dissector folder, I could not build, it gave me error in configuration stage. This is the only thing I could not follow from section 9.2 instruction.

Am I missing something here? I read the README.plugins in doc directory, but it seems it is outdated? I could not find epan/gryphon for instance and it did not match instruction on section 9.2.

The question here is I just want to ...(more) gravatar image[email protected] ( 2018-04-25 18:11:40 +0000 )edit

I think I found the new dll's that I added in /run/RelWithDebInfo. But the dll's doesn't seem to dissect when I open the wireshark.exe from this directory. Am I supposed to add these dll's plugins in some other folder? Since in version 1.12.6, there is a wireshark-gtk2 directory where I can test out my dlls. These are the same source code that I ported over from another machine with wireshark version based 1.12.6. which dissects fine with that version, so I am not sure why it did not function in version 2.6. I had to change some prototypes of some functions to upgrade from 1.12.6 to 2.6, but it did build successfully and dlls are generated it seems. Where and how can I test these new dlls? Do you have any idea? thanks gravatar image[email protected] ( 2018-04-26 00:01:45 +0000 )edit

Yes the instructions in 9.2 are required, you must add a CMakeListsCustom.txt with the required path to your custom plugin.

Gryphon has been moved to a built-in dissector, the docs will be updated. Use any other plugin to copy (and modify accordingly) the CMakeLists.txt and

The Wireshark API can and does change between versions, even 2.4 -> 2.6 for instance, so taking code written for 1.12.6 and porting it to 2.6.0 will definitely require changes.

When building a RelWithDebInfo build on Windows, the generated binaries and all supporting files are found in run/RelWithDebInfo. Running Wireshark from that directory will load all the plugins built. If you aren't getting the dissection you expect, then it's likely that you haven't correctly updated the dissector for use with 2.6.0.

grahamb gravatar imagegrahamb ( 2018-04-26 09:52:28 +0000 )edit

Our custom dll is to dissect l2tpv3 frames. It generates the custom dll in the RelWithDebInfo but when open wireshark, it is still dissecting as a default Cisco HDLC frame. Not sure what I'm missing here.Will be looking into this. Was wondering where to add this custom dissector code? Placing in plugins directory did not seem to work. And tried moving under wireshark/plugins/epan doesn't seem to work also. I have a dir path instead of just one file for this custom code. gravatar image[email protected] ( 2018-04-30 13:38:34 +0000 )edit

If the dll appears in the correct place in the RelWithDebInfo directory along with the other plugin dll's, then it is building correctly and it's likely to be code changes in Wireshark that is preventing your plugin from being called.

What does your protocol registration handoff routine look like?

grahamb gravatar imagegrahamb ( 2018-04-30 21:39:11 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-04-23 20:16:49 +0000 gravatar image

Using VS developer command prompt did not resolve the issue with the C compiler id and C++ compiler id undefined errors either. Had to copy rc.exe and rcdll.dll from C:\Program Files(x86)\Windows Kists\10.0\bin\x86 to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin. This resolved the issue and found this from some google "".

Also, my pc is windows 10 64 bit and when installed Qt, I can only install their beta version 5.11.0 and not the 5.9.1. So, there were about 3 Qt files given me build errors and had to commented out some code to be able to successfully build. Just so, if someone trying to figure out on this forum. This is the solution.

edit flag offensive delete link more


I think your environment is messed up. The Visual Studio command prompt should put the appropriate Windows Kit binary directory on the path for you. In particular, if you're building a Win64 version of Wireshark, with the x64 compilers, then the x64 directory of the Windows Kit should be on the path and random copying of files may temporarily "fix" your issue, but cause problems further down the road when rc.exe is updated in the Windows Kit, but you're still using older copied one.

I currently build the latest Wireshark trunk using VS2017 and Qt 5.10.1 without any build errors, and used VS2015 until April, again without build errors. Unfortunately the Wireshark build slaves for 2.4 aren't running right now, but they were also happy with VS2015 and Qt 5.9

grahamb gravatar imagegrahamb ( 2018-04-24 09:08:23 +0000 )edit

answered 2018-02-16 15:20:18 +0000

grahamb gravatar image

The compiler the production builds use for 2.4 is VS2015. It might work with VS2013, but probably not any earlier version.

A list of release versions and compilers used is in the Developers Guide here and as noted there; Using the release compilers is recommended for Wireshark development work.

Are you sure you have followed all the steps in the Developers Guide exactly as written?

edit flag offensive delete link more


did follow exactly for the nmake build and did not follow for cmake as I was trying to support both versions. The VS maybe the issue. I will have to install this VS2015 in another machine to try out as I do not want to break the nmake build environment for the earlier wireshark code versions as people are still using this versions in my group. Just trying to see I can upgrade to version 2_4 without having to re-install apps. I guess not. thank you for the prompt response. gravatar image[email protected] ( 2018-02-16 16:18:54 +0000 )edit

I have used VM's for my Wireshark Build environments for many years. Keeps Wireshark bits separated from anything else, easy to back up and move to a new host. My VM's have gone from Vista through to Win 10, and VS2010 to VS2017.

grahamb gravatar imagegrahamb ( 2018-02-16 17:02:23 +0000 )edit

I've a new virtural machine for 64 bit and downloaded the VS2015 and followed instruction. But getting the CMake compiler error as below:

C:\Development\wireshark\wireshark>"C:\Program Files\CMake\bin\cmake.exe" -DENABLE_CHM_GUIDES=on -G "Visual Studio 14 2015 Win64"
**-- The C compiler identification is unknown
-- The CXX compiler identification is unknown**
CMake Error at CMakeLists.txt:10 (project):
  No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:10 (project):
  No CMAKE_CXX_COMPILER could be found.

Even though I had in my batch file below to point to the C compiler explicitly and also set the environment. I can only get QT version 5.11 instead of 5.9 in open source for some reason, not sure that's the cause. Please suggest.

set WIRESHARK_BASE_DIR=C:\Development\wireshark
set QT5_BASE_DIR=C:\Qt\5.11.0\msvc2015_64
set VisualStudioVersion=14.0
(more) gravatar image[email protected] ( 2018-04-19 13:41:36 +0000 )edit

Neither of the batch file settings for Visual Studio are necessary, and may be making things worse. Using a newer version of Qt should be OK. Note that the Developers Guide states that you should ensure the directory containing cmake.exe is on the path, as you are using the full path to invoke CMake I assume you haven't done that.

I suspect that you aren't using a Visual Studio Command Prompt as detailed in the developers guide. As a test, what is the output of cl in your command shell where you are entering the CMake command?

grahamb gravatar imagegrahamb ( 2018-04-19 13:52:35 +0000 )edit

I used MSBuild Command Prompt for VS2015, since had a hard time finding VS Command prompt. Is that an issue? I tried without the VS settings in the batch file before and same error. Here's the gist of the CMakeError.log, something with rc.exe

Build started 4/18/2018 11:44:31 AM.
Project "C:\Development\wireshark\wireshark\CMakeFiles\3.11.1\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdCXX.tlog\".
  Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /nologo /W0 /WX- /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP /errorReport:queue CMakeCXXCompilerId.cpp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0 ...
(more) gravatar image[email protected] ( 2018-04-19 14:04:52 +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: 2018-02-16 14:35:29 +0000

Seen: 83 times

Last updated: Apr 26