THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Getting thousands of errors while linking Wireshark with QT library

  • retag add tags

Wireshark version : 3.2.7

OS : Windows

Issue : While building Wireshark code it is observed that there are thousands of errors when linking with QT library. I verified the QT installed path, QT5_BASE_DIR path in environment variable, all looks good. But, failing to link. What could be the issue.

(Link target) ->
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl AuthorListModel::metaObject(void)const " (?me
       taObject@AuthorListModel@@UEBAPEBUQMetaObject@@XZ) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl AuthorListModel::qt_metacast(char const *)" (?qt_metacast@AuthorL
       istModel@@UEAAPEAXPEBD@Z) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl AuthorListModel::qt_metacall(enum QMetaObject::Call,int,void * *)" (
       ?qt_metacall@AuthorListModel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl PluginListModel::metaObject(void)const " (?me
       taObject@PluginListModel@@UEBAPEBUQMetaObject@@XZ) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl PluginListModel::qt_metacast(char const *)" (?qt_metacast@PluginL
       istModel@@UEAAPEAXPEBD@Z) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl PluginListModel::qt_metacall(enum QMetaObject::Call,int,void * *)" (
       ?qt_metacall@PluginListModel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl ShortcutListModel::metaObject(void)const " (?
       metaObject@ShortcutListModel@@UEBAPEBUQMetaObject@@XZ) [C:\**\wireshark-3.2.7\wireshark.vcxproj]
         about_dialog.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl ShortcutListModel::qt_metacast(char const *)" (?qt_metacast@Short
       cutListModel@@UEAAPEAXPEBD@Z) [C:\U**\wireshark-3.2.7\wireshark.vcxproj]

Thank you.

kirankumarg.81's avatar
1
kirankumarg.81
asked 2023-12-03 18:52:28 +0000
grahamb's avatar
23.8k
grahamb
updated 2023-12-04 08:49:06 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

You should note that version 3.2.7 dropped out of support more than two years ago, you really should try to move to a supported version. See lifecycle for more info on versions.

As to your issue, it looks like your build environment isn't configured correctly and isn't linking with the Qt DLLs. Somewhere in the build output there should be the link command line which will show what the link is using.

grahamb's avatar
23.8k
grahamb
answered 2023-12-04 08:52:43 +0000
edit flag offensive 0 remove flag delete link

Comments

Sure Graham will ensure to move it to the latest version soon. I verified the paths provided and set for QT5, all looks fine and accessible. As you mentioned below is the link command after which the errors are observed.

130>Link:
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\UPAPPS\DevWorkarea\Package\wireshark-fresh-3.2.7\wireshark-3.2.7\run\RelWithDebInfo\Wireshark.exe" /INCREMENTAL:NO /NOLOGO run\RelWithDebInfo\ui.lib run\RelWithDebInfo\capchild.lib run\RelWithDebInfo\caputils.lib run\RelWithDebInfo\wireshark.lib C:\software\Qt\Qt5.12.2\5.12.2\msvc2017_64\lib\Qt5Multimedia.lib C:\software\Qt\Qt5.12.2\5.12.2\msvc2017_64\lib\Qt5PrintSupport.lib C:\software\Qt\Qt5.12.2\5.12.2\msvc2017_64\lib\Qt5Svg.lib C:\software\Qt\Qt5.12.2\5.12.2\msvc2017_64\lib\Qt5Widgets.lib C ...
(more)
kirankumarg.81's avatar kirankumarg.81 (2023-12-04 15:18:06 +0000) edit

<cont>

gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:NO /DEBUG /PDB:"C:/UPAPPS/DevWorkarea/Package/wireshark-fresh-3.2.7/wireshark-3.2.7/run/RelWithDebInfo/Wireshark.pdb" /SUBSYSTEM:WINDOWS /LARGEADDRESSAWARE /TLBID:1 /RELEASE /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/UPAPPS/DevWorkarea/Package/wireshark-fresh-3.2.7/wireshark-3.2.7/run/RelWithDebInfo/Wireshark.lib" /MACHINE:X64 /guard:cf  /machine:x64 /guard:cf wireshark.dir\RelWithDebInfo\file_dlg_win32.res wireshark.dir\RelWithDebInfo\wireshark.res wireshark.dir\RelWithDebInfo\file.obj wireshark.dir\RelWithDebInfo\fileset.obj wireshark.dir\RelWithDebInfo\console_win32.obj wireshark.dir\RelWithDebInfo\file_dlg_win32.obj

Anything I am missing or should I look into related to linking with QT library properly. Thanks in advance.

kirankumarg.81's avatar kirankumarg.81 (2023-12-04 15:18:52 +0000) edit

Wireshark version >= 4.2 should be compiled using Qt6. See https://www.wireshark.org/docs/wsdg_h...

On Windows I set these variables to compile:

set PLATFORM=X64
set WIRESHARK_QT6_PREFIX_PATH=C:\Qt\6.6.0\msvc2019_64
André's avatar André (2023-12-04 16:58:08 +0000) edit

Says in the question & the answer, the target is 3.2.7

grahamb's avatar grahamb (2023-12-04 17:00:02 +0000) edit

I am building Wireshark 3.2.7 and have set the below path for QT5.

QT5_BASE_DIR and built using below commands

cmake -G "Visual Studio 16 2019" -A x64 .

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

kirankumarg.81's avatar kirankumarg.81 (2023-12-04 17:02:35 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer