Ask Your Question
1

build errors. First time cmake user

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

christenmu@yahoo.com gravatar image

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

Christian_R gravatar image

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

Comments

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)

christenmu@yahoo.com 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

christenmu@yahoo.com 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 plugin.rc.in.

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.

christenmu@yahoo.com 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

Apparently I was incorrect in a previous comment, Gryphon remains a plugin.

grahamb gravatar imagegrahamb ( 2018-04-30 21:40:38 +0000 )edit

I believe this instruction maybe an issue. This is in proto_reg_handoff

pmi_handle = create_dissector_handle(dissect_pmi, proto_pmi);
dissector_add_uint("ip.proto", l2tpv3_protocol_id, pmi_handle);

I saw in gryphon, it uses dissectoraddunitwithpreference. Does the function dissectoradduint needs to be replaced? thanks in advance.

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-01 00:21:06 +0000 )edit

after I changed the function to dissector_add_uint_with_preference, the dll did not get generated, instead when I launched the wireshark.exe, it gave me this error for several dlls. Some dlls are not mine, but got this message saying Mutiple problems found. The plugin 'usbdump.dll' has no plugin_version symbol. and the same errors for ethercat.dll, grpyhon.dll, etc. including my custom dll.

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-01 00:44:25 +0000 )edit

oh, I saw my custom dll and gryphon.dll in run/RelWithDebInfo/plugins/2.6/epan instead of under run/RelWithDebInfo. It got generated, but still having issue dissecting. Looking at the packet-l2tp code and realized the proto_reg_handoff is the same as my custom dll. I am not sure these 2 source code can co-exist in rel2.6? I have the same code in rel1.12 and it worked fine. My custom dll took precedence over (dont know which dll gets generated for l2tp) if it's there. They both have the same IP_PROTO_L2TP (115) for identifier. One other thing in my code is find_dissector function. Does it still work?

docsis_mgt_handle = find_dissector ("docsis_mgmt");

Ok, my question now is can both dissectors co-exists. As both proto_reg_handoff_l2tp and proto_reg_handoff_pmi (my custom) are trying to register with the same IP_PROTO_L2TP it appears the l2tp always took precedence. For some reason, in older version ...(more)

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-01 00:47:13 +0000 )edit

AFAIK the order of registration isn't guaranteed. Have you tried disabling the built-in dissector via the GUI option Analyze | Enabled Protocols ?

grahamb gravatar imagegrahamb ( 2018-05-01 14:10:26 +0000 )edit

tried disabling ll2tp protocol from GUI Analyze->EnabledProtocols-> unchecked the l2tp, and the frames are decoded as IPv4 frames instead of custom frames. When I disabled, IPv4 (unchecked this box) and the frmaes are shown as generic Protocol 0x0800. I dont know how to enable the custom protocol.

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-01 14:48:48 +0000 )edit

I wasn't sure if disabling also stopped the registration, apparently it doesn't. I think you'll have to disable the built-in dissector in your build. Comment out the file in epan\dissectors\CMakeLists.txt, regenerate the CMake files and rebuild.

grahamb gravatar imagegrahamb ( 2018-05-01 14:54:26 +0000 )edit

was wondering before changing the build-in dissector, whether wireshark can provide a method to choose the frame preference. For example, in GUI, Edit->Preferences->Portocol->Frame->Treat all frames as L2TP? Currently, there's a way to treat all frames ad docsis frames or not with a box (checked or unchecked). Even if there's no GUI, do you know a source code for this view preferences to treat frames as?

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-01 15:53:32 +0000 )edit

here's one of my proto_reg_handoff file looks like. I tried to fix the warnings associated to my file and pretty much cleaned up. But when launched the wireshark I saw Wireshark prompted with "Multiple problems found... The plugin "usbdump.dll" has no "plugin_version symbol...." and similar messages for several of the dlls including mine. And was not sure this is causing my plugin to not recognized by the wireshark. I also downloaded the latest stable release version 2.6 on my pc and added the generated plugins dll's in /plugins/2.6/epan directory, but still did not recognized by the tool. In the old version 1.12, if I placed these dlls in the /plugins/1.12 directory, it works. I can view from Help->About Wireshark->Plugins, the dlls will show up there, but not in 2.6 version.

void
proto_reg_handoff_3146(void)
{
    static int initialized=FALSE;

    if (!initialized ...
(more)
christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 13:36:58 +0000 )edit

The proto_reg_handoff_xxx should look like this:

void
proto_reg_handoff_3146(void)
{
    dissector_handle_t l2tp_3146_handle = create_dissector_handle(dissect_3146, proto_3146);
    dissector_add_uint_with_preference("udp.port", global_3146_request_port, l2tp_3146_handle);
    dissector_add_uint_with_preference("udp.port", global_3146_data_port, l2tp_3146_handle);
}

Can you also show:

  1. The signature of the dissect_3146 function
  2. The part of your proto_register_xxx function that registers the protocol and preferences.
grahamb gravatar imagegrahamb ( 2018-05-03 14:13:18 +0000 )edit

The dissection function:

static void dissect_3146(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,void* data);

void
proto_register_3146(void)
{
    /* A header field is something you can search/filter on.
     * 
     * We create a structure to register our fields. It consists of an
     * array of hf_register_info structures, each of which are of the format
     * {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}.
     */


    if (proto_3146 == -1) {
        proto_3146 = proto_register_protocol (
            "BCM3146 Protocol", /* name */
            "BCM3146 Req",      /* short name */
            "bcm3146req"        /* abbrev */
            );
    }
}
christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 14:40:19 +0000 )edit

Here's another one with register

void
proto_register_bdcp(void)
{
    /* A header field is something you can search/filter on.
     *
     * We create a structure to register our fields. It consists of an
     * array of hf_register_info structures, each of which are of the format
     * {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}.
     */


    if (proto_bdcp == -1) {

        proto_bdcp = proto_register_protocol (
                        "BDCP Protocol",        /* name */
                        "BDCP",         /* short name */
                        "bdcp"          /* abbrev */
                        );

        bdcp_dissector_table = register_dissector_table ("bdcp",
                                    "BDCP Protocol",
                                    proto_bdcp,
                                    FT_UINT16, BASE_DEC);
        proto_register_field_array(proto_bdcp, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
        proto_register_subtree_array(ettrpcmd, array_length(ettrpcmd));
    }
}
christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 14:42:39 +0000 )edit

That looks OK apart from the superfluous conditionals around the registration calls. No need for that at all.

grahamb gravatar imagegrahamb ( 2018-05-03 15:16:22 +0000 )edit

The fact that you get errors from the distribution provided plugins concerns me. Until you can get a clean build from the unmodified source code that then runs without errors I think you're on shaky ground.

grahamb gravatar imagegrahamb ( 2018-05-03 15:18:00 +0000 )edit

Yes, not sure because I have windows 10 with 64 bit machine and also had to use a different qt version 5.11 instead of 5.9 per Wireshark instruction. I'm getting these warnings in the build regarding unknown option '/Qspectre' in the distributed code.

"C:\Development\wireshark\wireshark\Wireshark.sln" (default target) (1) ->
"C:\Development\wireshark\wireshark\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
"C:\Development\wireshark\wireshark\plugins\epan\wimaxasncp\wimaxasncp.vcxproj.metaproj" (default ta
rget) (126) ->
"C:\Development\wireshark\wireshark\plugins\epan\wimaxasncp\wimaxasncp.vcxproj" (default target) (12
7) ->
  cl : Command line warning D9002: ignoring unknown option '/Qspectre' [C:\Development\wireshark\wir
eshark\plugins\epan\wimaxasncp\wimaxasncp.vcxproj]
christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 15:42:46 +0000 )edit

The QSpectre warnings are because MS has been slow to update VS2015. There has been a recent change to the source to test the flag and only use it if supported.

Qt 5.9 is still available, the online installer gives you the option if you ignore the "Preview" element and expand the "Qt" element.

grahamb gravatar imagegrahamb ( 2018-05-03 15:57:02 +0000 )edit

yes, I tried to download the qt5.9 and got error in installation. That's why I had to use their 5.11 which installed successfully. May try again with qt5.9 later.

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 16:00:49 +0000 )edit

FWIW, I currently build with 10.1 with no issues.

grahamb gravatar imagegrahamb ( 2018-05-03 16:04:08 +0000 )edit

yeah, when I added my custom dlls in the downloaded wireshark folder /plugins/2.6/epan and when launch the wireshark, I got the following Multiple problems found. Dont know how to rid of these plugin_version issue.

The plugin 'bdcp.dll' has no "plugin_version" symbol

The plugin 'uepi.dll' has no "plugin_version" symbol

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 16:42:45 +0000 )edit

I think that's set by the following lines at the top pf the plugin CMakeLists.txt (from the gryphon plugin):

include(WiresharkPlugin)

# Plugin name and version info (major minor micro extra)
set_module_info(gryphon 0 0 4 0)

What do you have there for your errant plugins?

grahamb gravatar imagegrahamb ( 2018-05-03 17:10:20 +0000 )edit

mine is

include(WiresharkPlugin)

# Plugin name and version info (major minor micro extra)
set_module_info(bdcp 0 0 1 0)

But remember, I am having errors for plugin version not found for gryphon too when launched the wireshark from run->RelWithDebInfo. If I closed the the wireshark problem box, I can still open pcap files to view. But when I launched from downloaded wireshark tool on my pc, I did not see this error for gryphon.dll, but only for my custom dll. This suggests my build environment may have issue with this plugin_version. Not sure how to fix this.

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-03 17:31:07 +0000 )edit

The resource compiler is used to process the rc.in files and as you had issues with the resource compiler (rc.exe) not being on the path and you copied over the files from the Windows kit, I think that might be causing the plugin issue.

I fear you may have to uninstall VS2015, ensure all traces are removed, and then reinstall. I suppose you could try the repair option.

grahamb gravatar imagegrahamb ( 2018-05-03 18:00:51 +0000 )edit

So, I repaired the VS2015 and that fixed the rc.exe and redl.dll issue. But it did not fix the pluginversion issue. So, I removed the QT version and redownload the Qt 5.10. And rebuilt and now after the build and tried to launch the wireshark from RelWithDebInfo and I got wireshark error window saying Entry Point not found. isRightToLeft@QtPrivate@@YANCQStringView@@@Z could not be located in the dynamic link library. C:\Developement\wireshark\wireshark\run\RelWithDebInfo\Qt5 Gui.dll.

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-04 16:34:24 +0000 )edit

Did you delete your build directory and start again with the new VS and Qt? If not, then some old info will likely be cached.

Delete the build directory (not the source) and re-run the CMake generation step and then the build.

grahamb gravatar imagegrahamb ( 2018-05-07 16:22:27 +0000 )edit

I deleted the zlib folders and rebuilt and that seems to have solved the issue. Right now, it generated dll's fine,but still having issue when launching the wireshark it did not seem to recognize the custom dlls. I added these custom dlls in /wireshark26/plugins/2.6/epan and also in /wireshark26/plugins and also directly under wireshark26, but still it did not recognize the custom.dlls. In the Help menu under Plugins I can see the other dll's such as ehtercat.dll, gryphon.dll, wimax.dll etc, but not the custom ones. I dont know how to make these custom dlls to take into effect. This wasn't an issue in version 1.12.6 when I placed these custom dlls under /wireshark/plugins folder. Another difference is that the 1.12.6 custom dlls are generated with windows7 64 ...(more)

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-07 19:05:13 +0000 )edit

If you have correctly added your custom plugins to the build system, then they will be automagically copied to the correct place in the run directory. Having to manually copy them indicates that you haven't correctly added them to the build system.

It's not clear to me, but are you copying the custom dll's from a 1.12.6 build into a 2.6 build? If so, that won't work at all. You must build the plugins for 2.6 by adding the source code to the build.

I really do recommend deleting the build directory and regenerating and building again.

grahamb gravatar imagegrahamb ( 2018-05-07 19:49:33 +0000 )edit

sorry that I did not explained clearly. I have 2 virtual machines, one with windows7 wireshark version 1.12.6 which have the custom dlls working for more than 4-5 years and I am saving this as is, since this one works for sure.

I just copied those dlls source code to a new virtual machine which has windows 10 and wireshark base code verion 2.6. Which I am having issues with the custom dlls to get recognized by wireshark tool. The custom dlls are generated as expected under run/RelWithDebInfo/plugins/2.6/epan. I can see my dlls along with others under this directory.
What I am trying to say was I have a wireshark version 2.6 installed on my pc and when I copied these generated custom dll's from my virtual machine to my pc, I manually added to plugin directory like I did ...(more)

christenmu@yahoo.com gravatar image[email protected] ( 2018-05-07 21:10:14 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted
0

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

christenmu@yahoo.com 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 "https://stackoverflow.com/questions/3...".

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

Comments

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
0

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

Comments

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.

christenmu@yahoo.com 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 WIRESHARK_CYGWIN_INSTALL_PATH=C:\cygwin64
set VisualStudioVersion=14.0
set CMAKE_CXX_COMPILER="C ...
(more)
christenmu@yahoo.com 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).
PrepareForBuild:
  Creating directory "Debug\".
  Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  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
  CMakeCXXCompilerId.cpp
Link:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0 ...
(more)
christenmu@yahoo.com 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

Stats

Asked: 2018-02-16 14:35:29 +0000

Seen: 1,563 times

Last updated: Apr 26 '18