This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Wireshark plugin build fail (don’t find gcrypt.h)

0

Hello,

I recently pulled last Wireshark update from git repo and merged with my branch. After resovling some conflict I had, I realized there was some changes in plugin dir so I added CMakelists.txt en modified my Makefile.nmake/plugin.rc.in/Makefile.common/Makefile.am file in my plugin dir.

But now I'm having an issue with the gcrypt.h, "wireshark\wsutil/wsgcrypt.h(36) : fatal error C1083: Cannot open include file 'gcrypt.h' : No such file or directory"

I tried to link the lib by adding ....\wsutil\libwsutil.lib without any good result.

When I try to add GCRYPT_LIBS or GNUTLS_DIR I got command line warnings and unresolved external symbol error.

Does something else has changed ? Or maybe I'm doing something wrong ?

asked 02 Feb '15, 07:18

Afrim's gravatar image

Afrim
160101116
accept rate: 22%

What is your OS and how are you configuring and running the build, i.e. autotools\Make or CMake?

(02 Feb '15, 07:24) grahamb ♦

Well I'm using running nmake (so OS is windows), don't know if that's what you asked for

(02 Feb '15, 07:44) Afrim

Can you build the sources without your changes? This is to determine if the error is in your environment, or your changes.

The reported error is in a core library (wsutil), so it looks like an environment issue.

(02 Feb '15, 08:02) grahamb ♦

You mean without my plugin ? Or without all things i've tried to resolve my problem (in Makefile.nmake) ?

(02 Feb '15, 08:07) Afrim

Assuming you have copies of all your changes, revert everything back to plain unmodified sources, then nmake -f Makefile.nmake distclean and then build again.

(02 Feb '15, 08:29) grahamb ♦

The build is successfull without any changes. It's weird because before the merge all was OK in my build even with my plugin

(03 Feb '15, 01:03) Afrim
showing 5 of 6 show 1 more comments

One Answer:

0

Just because something merges doesn't mean it will build.

Without changing anything else, merge your changes, cd into your plugins directory and nmake -f Makefile.nmake > tmp.txt there. Post the output of tmp.txt back here.

answered 03 Feb '15, 02:15

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

    "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe" /                   -f Makefile.nmake PLUGIN_TARGET= process-plugins
    cd docsis
    "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe" /                   -f Makefile.nmake 
Making plugin.c
Updating plugin.c
    sed -e s/@[email protected]/docsis/  -e s/@[email protected]/0,0,5,0/  -e s/@[email protected]/1,99,2,0/  -e s/@[email protected]/0.0.5.0/  -e s/@[email protected]/docsis/  -e s/@[email protected]/1.99.2/  -e s/@[email protected]/MSVC2010/  < plugin.rc.in > docsis.rc
    rc  /r docsis.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385

Copyright (C) Microsoft Corporation. All rights reserved.

cl -WX /DWINPCAP_VERSION=4_1_3 /Zi /WX /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /D_BIND_TO_CURRENT_CRT_VERSION=1 /MP /w34295 /w34189  /I../.. /IC:\Wireshark-win32-libs\gtk2\include\glib-2.0  /IC:\Wireshark-win32-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -DG_DISABLE_SINGLE_INCLUDES  /IC:\Wireshark-win32-libs\WPdpack\include -Fd.\ -c packet-bintrngreq.c packet-bpkmattr.c packet-bpkmreq.c packet-bpkmrsp.c packet-cmctrlreq.c packet-cmctrlrsp.c packet-cmstatus.c packet-intrngreq.c packet-dbcreq.c packet-dbcrsp.c packet-dbcack.c packet-dccack.c packet-dccreq.c packet-dccrsp.c packet-dcd.c packet-dpvreq.c packet-dpvrsp.c packet-docsis.c packet-dsaack.c packet-dsareq.c packet-dsarsp.c packet-dscack.c packet-dscreq.c packet-dscrsp.c packet-dsdreq.c packet-dsdrsp.c packet-macmgmt.c packet-map.c packet-mdd.c packet-regack.c packet-regreq.c packet-regreqmp.c packet-regrsp.c packet-regrspmp.c packet-rngreq.c packet-rngrsp.c packet-sync.c packet-tlv.c packet-tlv-cmctrl.c packet-type29ucd.c packet-uccreq.c packet-uccrsp.c packet-ucd.c packet-vendor.c plugin.c 

packet-bintrngreq.c packet-bpkmattr.c packet-bpkmreq.c packet-bpkmrsp.c packet-cmctrlreq.c packet-cmctrlrsp.c packet-cmstatus.c packet-intrngreq.c packet-dbcreq.c packet-dbcrsp.c packet-dbcack.c packet-dccack.c packet-dccreq.c packet-dccrsp.c packet-dcd.c packet-dpvreq.c packet-dpvrsp.c packet-docsis.c packet-dsaack.c packet-dsareq.c packet-dsarsp.c packet-dscack.c packet-dscreq.c packet-dscrsp.c packet-dsdreq.c packet-dsdrsp.c packet-macmgmt.c packet-map.c packet-mdd.c packet-regack.c packet-regreq.c packet-regreqmp.c packet-regrsp.c packet-regrspmp.c packet-rngreq.c packet-rngrsp.c packet-sync.c packet-tlv.c packet-tlv-cmctrl.c packet-type29ucd.c packet-uccreq.c packet-uccrsp.c packet-ucd.c packet-vendor.c plugin.c link -dll /out:docsis.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x86 /RELEASE /SafeSEH /DYNAMICBASE /FIXED:no packet-bintrngreq.obj packet-bpkmattr.obj packet-bpkmreq.obj packet-bpkmrsp.obj packet-cmctrlreq.obj packet-cmctrlrsp.obj packet-cmstatus.obj packet-intrngreq.obj packet-dbcreq.obj packet-dbcrsp.obj packet-dbcack.obj packet-dccack.obj packet-dccreq.obj packet-dccrsp.obj packet-dcd.obj packet-dpvreq.obj packet-dpvrsp.obj packet-docsis.obj packet-dsaack.obj packet-dsareq.obj packet-dsarsp.obj packet-dscack.obj packet-dscreq.obj packet-dscrsp.obj packet-dsdreq.obj packet-dsdrsp.obj packet-macmgmt.obj packet-map.obj packet-mdd.obj packet-regack.obj packet-regreq.obj packet-regreqmp.obj packet-regrsp.obj packet-regrspmp.obj packet-rngreq.obj packet-rngrsp.obj packet-sync.obj packet-tlv.obj packet-tlv-cmctrl.obj packet-type29ucd.obj packet-uccreq.obj packet-uccrsp.obj packet-ucd.obj packet-vendor.obj plugin.obj ....\epan\libwireshark.lib C:\Wireshark-win32-libs\gtk2\lib\glib-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gmodule-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gobject-2.0.lib docsis.res Creating library docsis.lib and object docsis.exp cd .. cd ethercat "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe" / -f Makefile.nmake Making plugin.c Updating plugin.c sed -e s/@[email protected]/ethercat/ -e s/@[email protected]/0,1,0,0/ -e s/@[email protected]/1,99,2,0/ -e s/@[email protected]/0.1.0.0/ -e s/@[email protected]/ethercat/ -e s/@[email protected]/1.99.2/ -e s/@[email protected]/MSVC2010/ < plugin.rc.in > ethercat.rc rc /r ethercat.rc Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385

Copyright (C) Microsoft Corporation. All rights reserved.

cl -WX /DWINPCAP_VERSION=4_1_3 /Zi /WX /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /D_BIND_TO_CURRENT_CRT_VERSION=1 /MP /w34295 /w34189  /I../.. /IC:\Wireshark-win32-libs\gtk2\include\glib-2.0  /IC:\Wireshark-win32-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -DG_DISABLE_SINGLE_INCLUDES  /IC:\Wireshark-win32-libs\WPdpack\include -Fd.\ -c packet-ams.c packet-ecatmb.c packet-esl.c packet-ethercat-datagram.c packet-ethercat-frame.c packet-ioraw.c packet-nv.c plugin.c 

packet-ams.c packet-ecatmb.c packet-esl.c packet-ethercat-datagram.c packet-ethercat-frame.c packet-ioraw.c packet-nv.c plugin.c link -dll /out:ethercat.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x86 /RELEASE /SafeSEH /DYNAMICBASE /FIXED:no packet-ams.obj packet-ecatmb.obj packet-esl.obj packet-ethercat-datagram.obj packet-ethercat-frame.obj packet-ioraw.obj packet-nv.obj plugin.obj ....\epan\libwireshark.lib ....\wsutil\libwsutil.lib C:\Wireshark-win32-libs\gtk2\lib\glib-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gmodule-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gobject-2.0.lib ethercat.res Creating library ethercat.lib and object ethercat.exp cd .. cd gryphon "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe" / -f Makefile.nmake Making plugin.c Updating plugin.c sed -e s/@[email protected]/gryphon/ -e s/@[email protected]/0,0,4,0/ -e s/@[email protected]/1,99,2,0/ -e s/@[email protected]/0.0.4.0/ -e s/@[email protected]/gryphon/ -e s/@[email protected]/1.99.2/ -e s/@[email protected]/MSVC2010/ < plugin.rc.in > gryphon.rc rc /r gryphon.rc Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385

Copyright (C) Microsoft Corporation. All rights reserved.

cl -WX /DWINPCAP_VERSION=4_1_3 /Zi /WX /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /D_BIND_TO_CURRENT_CRT_VERSION=1 /MP /w34295 /w34189  /I../.. /IC:\Wireshark-win32-libs\gtk2\include\glib-2.0  /IC:\Wireshark-win32-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -DG_DISABLE_SINGLE_INCLUDES  /IC:\Wireshark-win32-libs\WPdpack\include -Fd.\ -c packet-gryphon.c plugin.c 

plugin.c packet-gryphon.c link -dll /out:gryphon.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x86 /RELEASE /SafeSEH /DYNAMICBASE /FIXED:no packet-gryphon.obj plugin.obj ....\epan\libwireshark.lib C:\Wireshark-win32-libs\gtk2\lib\glib-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gmodule-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gobject-2.0.lib gryphon.res Creating library gryphon.lib and object gryphon.exp cd .. cd irda "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe" / -f Makefile.nmake Making plugin.c Updating plugin.c sed -e s/@[email protected]/irda/ -e s/@[email protected]/0,0,6,0/ -e s/@[email protected]/1,99,2,0/ -e s/@[email protected]/0.0.6.0/ -e s/@[email protected]/irda/ -e s/@[email protected]/1.99.2/ -e s/@[email protected]/MSVC2010/ < plugin.rc.in > irda.rc rc /r irda.rc Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385

Copyright (C) Microsoft Corporation. All rights reserved.

cl -WX /DWINPCAP_VERSION=4_1_3 /Zi /WX /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /D_BIND_TO_CURRENT_CRT_VERSION=1 /MP /w34295 /w34189  /I../.. /IC:\Wireshark-win32-libs\gtk2\include\glib-2.0  /IC:\Wireshark-win32-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -DG_DISABLE_SINGLE_INCLUDES  /IC:\Wireshark-win32-libs\WPdpack\include -Fd.\ -c packet-ircomm.c packet-irda.c packet-sir.c plugin.c 

packet-ircomm.c packet-irda.c packet-sir.c plugin.c link -dll /out:irda.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x86 /RELEASE /SafeSEH /DYNAMICBASE /FIXED:no packet-ircomm.obj packet-irda.obj packet-sir.obj plugin.obj ....\epan\libwireshark.lib C:\Wireshark-win32-libs\gtk2\lib\glib-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gmodule-2.0.lib C:\Wireshark-win32-libs\gtk2\lib\gobject-2.0.lib irda.res Creating library irda.lib and object irda.exp cd .. cd myPLugin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\nmake.exe" / -f Makefile.nmake

Here is the output without any changes, the error says he don’t know how to make ‘../../tools/make-dissector-reg’, this is because my makefile.nmake (in my plugin) is old. In fact the directory of myPlugin is old (it’s been awhile since I didn’t merge with the official wireshark repo). So basically I took an exemple in another plugin to update my files. I got 5 plugin but 2 of these need encryption so I need to include wsutil/wsgcrypt.h, but it seems like my plugins didn’t have access to Wireshark lib (The 3 other plugin are building correctly).

(03 Feb ‘15, 03:08) Afrim

All that’s normal output for building the standard plugins and doesn’t give us any clue what’s up with your plugin.

Yes, the plugins build has undergone some changes, you’ll have to adapt the standard plugin build files to compile your plugin and probably modify your plugin as well if the interfaces it uses to Wireshark have changed.

Can you try again, this time cd into your actual plugin directory nmake .. clean and then nmake again, posting the output.

(03 Feb ‘15, 04:35) grahamb ♦

The build doesn’t even start and there is nothing in tmp.txt. It tells that he don’t know how to make ‘../../tools/make-dissector-reg’ but that’s obvious because there is no more make-dissector-reg.

Now if make some changes on my plugin files (makefile.*, plugin.rc.in, etc) to fit with the “new way” i got this output.

sed -e s/@[email protected]/myPlugin/ -e s/@[email protected]/0,0,1,0/ -e s/@[email protected]/1,99,2,0/ -e s/@[email protected]/0.0.1.0/ -e s/@[email protected]/myPlugin/ -e s/@[email protected]/1.99.2/ -e s/@[email protected]/MSVC2010/ < plugin.rc.in > myPlugin.rc rc /r myPlugin.rc Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385

Copyright (C) Microsoft Corporation. All rights reserved.

cl -WX /DWINPCAP_VERSION=4_1_3 /Zi /WX /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /D_BIND_TO_CURRENT_CRT_VERSION=1 /MP /w34295 /w34189  /I../.. /IC:\Wireshark-win32-libs\gtk2\include\glib-2.0  /IC:\Wireshark-win32-libs\gtk2\lib\glib-2.0\include  -DG_DISABLE_DEPRECATED  -DG_DISABLE_SINGLE_INCLUDES  /IC:\Wireshark-win32-libs\WPdpack\include -Fd.\ -c packet-myPlugin.c plugin.c

packet-myPlugin.c plugin.c C:\WiresharkLastVersion\wsutil/wsgcrypt.h(36) : fatal error C1083: Cannot open include file: ‘gcrypt.h’: No such file or directory

(03 Feb ‘15, 05:10) Afrim
1

OK, so it appears that your plugin includes wsgcrypt.h, possibly via other includes, and that file includes the third party gcrypt.h.

To allow the compiler to find that include you will need to modify CFLAGS in your plugins Makefile.nmake to include $(GNUTLS_FLAGS) and to link with the libraries modify LINK_PLUGIN_WITH to include ....\wsutil\libwsutil.lib and possibly $(GNUTLS_LIBS) as well.

(03 Feb ‘15, 05:40) grahamb ♦

I already did the 2 first steps and it tells me some unresolved external symbol. I’ll try with also the $(GNUTLS_LIBS) in LINK_PLUGIN_WITH .

EDIT : in my plugin dir i added $(GNUTLS_FLAGS) to CFLAGS so i got CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \ /I../.. $(GLIB_CFLAGS) $(GNUTLS_FLAGS)\ /I$(PCAP_DIR)\include then i added ….\wsutil\libwsutil.lib and $(GNUTLS_LIBS) to LINK_PLUGIN_WITH

then I ran nmake….clean and nmake and I got this output : cl -WX /DWINPCAP_VERSION=4_1_3 /Zi /WX /MD /O2 /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DPSAPI_VERSION=1 /D_BIND_TO_CURRENT_CRT_VERSION=1 /MP /w34295 /w34189 /I../.. /IC:\Wireshark-win32-libs\gtk2\include\glib-2.0 /IC:\Wireshark-win32-libs\gtk2\lib\glib-2.0\include -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES /IC:\Wireshark-win32-libs\WPdpack\include -Fd.\ -c packet-myPlugin.c packet-myPlugin.c C:\WiresharkLastVersion\wsutil/wsgcrypt.h(36) : fatal error C1083: Cannot open include file: ‘gcrypt.h’: No such file or directory

In my opinion there is something wrong because I should see something like C:\Wireshark-win32-libs\gnutls-3.2.15-2.7-win32ws\include

(03 Feb ‘15, 05:52) Afrim

Ok I resolved my problem It’s $(GNUTLS_CFLAGS) which was what I did but I also need $(GNUTLS_LIBS) in LINK_PLUGIN_WITH to avoid unresolved external symbol error.

Thank you grahamb :)

(03 Feb ‘15, 06:16) Afrim

Sorry for the typo, got there in the end though.

FWIW, I just looked at what the makefile in epan did for including the GNUTLS stuff.

(03 Feb ‘15, 06:34) grahamb ♦
showing 5 of 7 show 2 more comments