Building wireshark on Windows 10 Fails.

  • retag add tags

https://www.wireshark.org/docs/wsdg_h...

Generating Build files fails when I run the following command from the above link

msbuild /m /p:Configuration=RelWithDebInfo Wireshark.sln.

It gives me 3687 number of linker errors some of them are

libqtmain.a(qtmain_win.o) : error LNK2001: unresolved external symbol _Znay [C:\Users\sysadmin\Development\wireshark\wireshark.vcxproj]
         libqtmain.a(qtmain_win.o) : error LNK2001: unresolved external symbol _Z5qMainiPPc [C:\Users\sysadmin\Development\wireshark\wireshark.vcxproj]
         libqtmain.a(qtmain_win.o) : error LNK2001: unresolved external symbol _ZdaPv [C:\Users\sysadmin\Development\wireshark\wireshark.vcxproj]
         C:\Users\sysadmin\Development\wireshark\run\RelWithDebInfo\Wireshark.exe : fatal error LNK1120: 3686 unresolved externals [C:\Users\sysadmin\Development\wireshark
       \wireshark.vcxproj]

Can anyone please help me with this?

Thank you.

Vijayeendra's avatar
1
Vijayeendra
asked 2021-05-27 11:28:30 +0000
cmaynard's avatar
11.1k
cmaynard
updated 2021-05-27 13:07:13 +0000
edit flag offensive 0 remove flag close merge delete

Comments

Looks similar to Error compiling Wireshark with Visual Studio 2019.
Work through the steps mentioned there and verify the dev environment was setup according to the dev guide.

Chuckc's avatar Chuckc (2021-05-27 13:29:09 +0000) edit

Hi,

I have actually followed all steps, relooked into the steps and checked all steps everything looks ok. But unable to rectify why the build fails.

Thank you

Vijayeendra's avatar Vijayeendra (2021-05-27 16:26:38 +0000) edit

What do you have set for the env var QT5_BASE_DIR? And what version of CMake are you using?

grahamb's avatar grahamb (2021-05-27 18:48:37 +0000) edit

Hi,

The build was successful. I created a separate build folder wsbuild_64 and re-directed the build files into that directory by giving command

cmake -G "Visual Studio 16 2019" -A x64 ..\wireshark -B C:\Users\sysadmin\Development\wsbuild64

Later I built the code in that folder and it was successful.

Thank you

Vijayeendra's avatar Vijayeendra (2021-05-28 04:24:22 +0000) edit

"A separate build folder", separate from what?

That kind of change has never been needed before, but if it works for you. Note that the WSDG does say to use a separate build folder, i.e. source in C:\Development\Wireshark and build in C:\Development\wsbuild64. The WSDG also notes that 32 and 64 bit builds require a separate build directory.

Build directories are expendable, they can be deleted at any time and the CMake generation step run again.

This is needed if any 3rd party components are changed, e.g, the version of Qt, as CMake caches anything found and won't update (or even search) again. A somewhat simpler option is to delete the CMakeCache.txt file in the build dir.

grahamb's avatar grahamb (2021-05-28 07:56:08 +0000) edit
add a comment see more comments