Ask Your Question

I have fatal error LNK1181 when rebuild wireshark on Window

asked 2021-05-07 08:46:45 +0000

huong gravatar image

updated 2021-05-07 09:01:45 +0000


I am trying follow this instruction to build Wireshark on window:

The build was successful and I was be able to run Wireshark.exe, so I started to follow this instruction to add the plugins for wireshark:

But after follow each steps, my plugins does not show the foo.ddl, I thought that I did something wrong for configuration of the plugins, so I decided to delete the build directory and build wireshark again just to make sure.

After doing everything I did the first time I built, it show this error:

 Build FAILED.

   "C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
   "C:\Development\wsbuild64\wireshark.vcxproj.metaproj" (default target) (2) ->
   "C:\Development\wsbuild64\wireshark.vcxproj" (default target) (147) ->
   (Link target) ->
     LINK : fatal error LNK1181: cannot open input file 'C:\Development\wsbuild64\ui\qt\qtui.dir\RelWithDebInfo\mocs_compilation_Debug.obj' [C:\Development\wsbuild64\wireshark.vcxproj]

0 Warning(s)
1 Error(s)

I have tried to clean and then recompile again, but it still showing errors. So I decided to delete the directory, try to build it once more time, but unfortunately I still got this error and I do not know why. Can someone help me? I really appreciate, this is my first time working with Wireshark.

Edit: When I open folder C:\Development\wsbuild64\ui\qt\qtui.dir\RelWithDebInfo\ as shown in the error, there is no mocs_compilation_Debug.obj, does this mean that I am missing 1 file? Is there any way I can add it?

edit retag flag offensive close merge delete


Are you building with sources from git, or from a tarball? What is the git commit or version of the tarball?

grahamb gravatar imagegrahamb ( 2021-05-07 09:30:57 +0000 )edit

Hi, I am building source from git, just like in the instruction from wireshark: git clone

huong gravatar imagehuong ( 2021-05-07 09:46:02 +0000 )edit

OK, it works for me and the buildbots, so is likely to be something local in your environment. Just be aware that when living on the bleeding edge of master that there may be occasional unintentional breakages. You can also check the buildbots to see if they can build:

I'm not sure if you have done this but think you should try the "nuclear" option of deleting the build directory and generating a new build solution, preferably without your additions, and when that's working move on to adding the plugin.

grahamb gravatar imagegrahamb ( 2021-05-07 10:06:28 +0000 )edit

yes thank you for your comment, I deleted the build directory and try once again but it still occurs the same error, maybe there is something in my environment, I will check and see if I installed everything before right. It just really confusing because it worked before.

huong gravatar imagehuong ( 2021-05-07 10:35:01 +0000 )edit

Do you have all the required env vars setup correctly?

grahamb gravatar imagegrahamb ( 2021-05-07 10:52:25 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2021-05-10 08:43:11 +0000

huong gravatar image

updated 2021-05-12 21:30:45 +0000

cmaynard gravatar image

Hi, I have solved the problem but I do not know why it occurred. The problem was that in wireshark.vcxproj file, it is trying to find the mocs_compilation_Debug.obj file.

But in my case, there is no such file in C:\Development\wsbuild64\ui\qt\qtui.dir\RelWithDebInfo direction, there is only file mocs_compilation_RelWithDebInfo.obj

So I replace the name of mocs_compilation_Debug.obj with mocs_compilation_RelWithDebInfo.obj, then the cmake runs fine, and wireshark application is built. Although I do not understand the real problem behinds it, but I hope this will work well.

edit flag offensive delete link more


You've fixed the immediate issue, but without finding out how the errant information was inserted (presumably by the CMake generation step) you may run into the problem again.

grahamb gravatar imagegrahamb ( 2021-05-10 09:02:37 +0000 )edit

You may have to include the qt debug info in your qt setup. Has to be explisitly downloaded if I remember correctly.

Anders gravatar imageAnders ( 2021-05-10 09:13:17 +0000 )edit

If the Qt PDBs are missing this usually just causes a link warning. In this case the CMake generated .vcxproj has errant info where the locally compiled object file has a strange name.

grahamb gravatar imagegrahamb ( 2021-05-10 10:05:37 +0000 )edit

I've encountered this exact same problem after upgrading CMake from 3.19.8 to 3.20.2. I was going to downgrade back to 3.19.8, but I don't have time to do that today. @huong, what version of CMake are you running? If it's 3.20.x, you might want to try 3.19.8 to see if that resolves the problem.

NOTE: I do not experience this problem with 3.4.5 sources and CMake 3.20.2, only with master, so I don't think this is a CMake problem, per se.

cmaynard gravatar imagecmaynard ( 2021-05-12 21:29:07 +0000 )edit
Chuckc gravatar imageChuckc ( 2021-05-12 21:50:36 +0000 )edit

answered 2021-05-14 01:09:22 +0000

Gerald Combs gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2021-05-07 08:46:45 +0000

Seen: 391 times

Last updated: May 14 '21