Ask Your Question
0

could not find any instance of Visual Studio

asked 2022-10-11 00:51:49 +0000

m.kitagawa@tashiro-t.co.jp gravatar image

It used to work, but when I installed the Libs for Specter component, I got the following error.

C:\Development\wsbuild64>cmake -G "Visual Studio 16 2019" -A x64 C:\Development\wireshark

CMake Error at CMakeLists.txt:39 (project):

Generator Visual Studio 16 2019

could not find any instance of Visual Studio.

Even setting the path of the EXE to VS2019 in the Path environment variable was useless.

Moreover, menus such as "x64 Native Tools Command Prompt for VS 2019" under VisualStadio2019 in the startup menu have been deleted.

The details are as follows.

Previously the above command worked.

I got the below error message in CMakeError.log.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(486,5): error MSB8040: Spectre mitigation library is required for this project. For the toolsets and architectures used, install them from the Visual Studio Installer (individual components tab). Detailed information:https://aka.ms/Ofhn4c [C:\Development\wsbuild64\CMakeFiles\CMakeTmp\cmTC_85026.vcxproj]

I installed the Libs for Specter component

I want to resolve the instance not found error.

edit retag flag offensive close merge delete

Comments

I selected "Desktop development with C++" in the installer and reinstalled it, but I can't solve it.

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-11 01:36:48 +0000 )edit

Setting the following environment variables solved it.

VS160COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools"

But I am getting the first error.

I want to resolve this error.

All individual components named "Libs for Specter" are already installed.

The full text of the error message is below.

Performing C SOURCE FILE Test C_Qspectre_VALID failed with the following output:

Change Dir: C:/Development/wsbuild64/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe cmTC_0715b.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=16.0 /v:m && .NET Framework 向け Microsoft (R) Build Engine バージョン 16.11.2+f32259642

Copyright (C) Microsoft Corporation.All rights reserved.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(486,5): error MSB8040: Spectre mitigation library is required for this project. For ...(more)

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-11 02:52:13 +0000 )edit

I solved it by installing "MSVC v142~Libs for Specter".

But I got a new error.

If it's better to ask the question in another thread, please let me know.

For the time being, I will continue as is.

Please help me to resolve this error.

The error message is below.

None of the files existed in CMakeTmp.

==================================================

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:

Change Dir: C:/Development/wsbuild64/CMakeFiles/CMakeTmp

(omission)

cl /c /Zi /W3 /WX- /diagnostics:caret /MP /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D CHECK_FUNCTION_EXISTS=pthread_create /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /guard:cf /fp:precise /Qspectre /Zc:wchar_t /Zc:forScope /Zc:inline /std:c11 /Fo"cmTC_14dfa.dir\Debug\" /Fd"cmTC_14dfa.dir\Debug\vc142.pdb" /external:W3 /Gd /TC /wd4200 /wd5105 /errorReport:queue /Zo /utf-8 /w34295 /w34100 /w34189 "C:\Program Files\CMake\share\cmake-3.24\Modules\CheckFunctionExists.c ...(more)

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-11 05:38:01 +0000 )edit

Try removing the wsbuild64 directory, re-creating it, and running CMake again in that directory.

If that doesn't work, try to attach all the output from CMake here.

Guy Harris gravatar imageGuy Harris ( 2022-10-11 08:35:21 +0000 )edit

The command prompt showed the following error message:

Changing to "WIRESHARK_QT6_PREFIX_PATH=C:\Qt\6.4.0" worked for me.

command prompt=========================================

CMake Error at CMakeLists.txt:1236 (find_package):

By not providing "FindQt6Core5Compat.cmake" in CMAKE_MODULE_PATH this

project has asked CMake to find a package configuration file provided by

"Qt6Core5Compat", but CMake did not find one.

Could not find a package configuration file provided by "Qt6Core5Compat"

=========================================

But I got the below error.

command prompt=========================================

CMake Warning at CMakeLists.txt:594 (message): Windows SDK 10.0.19041.0 doesn't support C11. Please make sure you're using 10.0.20348.0 or later.

=========================================

When I installed the Windows SDK 10.0.20348.0 and re-executed it, the following error occurred.

As you can see, it's an error with the same issue number as the first error.

I don't know what is wrong please help me.

command prompt=========================================

CMake Error ...(more)

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-11 23:33:40 +0000 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2022-10-14 00:11:35 +0000

m.kitagawa@tashiro-t.co.jp gravatar image

I thought it was completed, but the following error occurs when building from VS2019.

Severity Level Code Description Project File Line Suppression State

error MSB3073 command "setlocal

set PATH=C:/Qt/6.2.4/msvc2019_64/bin;%PATH%

if %errorlevel% neq 0 goto :cmEnd

C:\Qt\6.2.4\msvc2019_64\bin\windeployqt.exe --no-compiler-runtime --verbose 0 --pdb C:/Development/wsbuild64/run/RelWithDebInfo/Wireshark.exe

if %errorlevel% neq 0 goto :cmEnd

:cmEnd

endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone

:cmErrorLevel

exit /b %1

:cm Done

if %errorlevel% neq 0 goto :VCEnd

:VCEnd" exited with code 1. copy_qt_dlls C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 155

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. ethercat C:\Development\wsbuild64\plugins\epan\ethercat\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. irda C:\Development\wsbuild64\plugins\epan\irda\LINK 1

Severity Level Code Description Project File Line Suppression State

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. opcua C:\Development\wsbuild64\plugins\epan\opcua\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. mate C:\Development\wsbuild64\plugins\epan\mate\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. gryphon C:\Development\wsbuild64\plugins\epan\gryphon\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. stats_tree C:\Development\wsbuild64\plugins\epan\stats_tree\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. transum C:\Development\wsbuild64\plugins\epan\transum\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. unistim C:\Development\wsbuild64\plugins\epan\unistim\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. wimaxmacphy C:\Development\wsbuild64\plugins\epan\wimaxmacphy\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. wimaxasncp C:\Development\wsbuild64\plugins\epan\wimaxasncp\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. wimax C:\Development\wsbuild64\plugins\epan\wimax\LINK 1

Error LNK1181 Cannot open input file '......\run\RelWithDebInfo\wireshark.lib'. profinet C:\Development\wsbuild64\plugins\epan\profinet\LINK 1

Error LNK1181 Cannot open input file 'run\RelWithDebInfo\wireshark.lib'. rawshark C:\Development\wsbuild64\LINK 1

Error LNK1181 Cannot open input file 'run\RelWithDebInfo\wireshark.lib'. sharkd C:\Development\wsbuild64\LINK 1

Error LNK1181 Cannot open input file 'run\RelWithDebInfo\wireshark.lib'. tshark C:\Development\wsbuild64\LINK 1

Error LNK1181 Cannot open input file 'run\RelWithDebInfo\wireshark.lib'. text2pcap C:\Development\wsbuild64\LINK 1

Error LNK1181 Cannot open input file 'run\RelWithDebInfo\wireshark.lib'. dftest C:\Development\wsbuild64\LINK 1

Error LNK1181 Cannot open input file 'run\RelWithDebInfo\wireshark.lib'. wireshark C:\Development\wsbuild64\LINK 1

edit flag offensive delete link more

Comments

I was able to build by setting "CMAKE_PREFIX_PATH=C:\Qt\6.2.4\msvc2019_64" in the system environment variable.

But when I run it in VS2019 the following exception is thrown.

If you continue execution with F5, Wireshark will start.

I've tried both with Degug and RelWithDebInfo and the same exception is thrown.

Running C:\Development\wsbuild64\run\RelWithDebInfo\Wireshark.exe directly seems to start fine.

"Identifier "stdout" is not defined" when accessing stdout in Degug mode.

Why can't I access stdout?

Also, why is the exception thrown?

=======================================================

Wireshark.exe caused a breakpoint.

Here is where the error stopped:

wslog.c

line 803,804

stdout_color_enabled = g_log_writer_supports_color(fileno(stdout));

stderr_color_enabled = g_log_writer_supports_color(fileno(stderr));

=======================================================

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-14 01:26:02 +0000 )edit
0

answered 2022-10-13 04:50:44 +0000

Guy Harris gravatar image

Unfortunately, at least for Qt 6, the Qt installer's "Qt 6.4 for desktop development" option installs Qt 6.4.0 AND installs only libraries and headers for MinGW-w64; it does NOT install libraries and headers for Visual Studio.

This is not what should be installed if you want to build with Visual Studio.

Equally unfortunately, the Windows setup section of the Wireshark Developer's Guide does NOT warn the user not to select that option and tell the user to go with the default "Custom installation" option.

I will update the documentation.

What you should do is:

  • remove the C:\Qt directory;
  • run the Qt installer;
  • use the "Custom installation" option, which appears to be the default option;
  • in the "Custom installation" screen, open up the item for the version of Qt to install - I would recommend that you install 6.2.4, not 6.3.2 or 6.4.0, as Wireshark builds for Windows are currently done with 6.2.4, and there might be problems building with later versions;
  • unless you want to take extra time downloading and installing other components NOT required for Wireshark, just select "MSVC 2019 64-bit", "Qt 5 Compatibility Module", and "Qt Debug Information Files";
  • do the installation.
edit flag offensive delete link more

Comments

Building with lower warning level gave a different error.

LINK : fatal error LNK1181: Cannot open input file 'mingw32.lib'. [C:\Development\wsbuild64\wireshark.vcxproj]

Where can I get mingw32.lib?

I installed mingw-get-setup.exe, but I didn't get it.

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-13 06:18:16 +0000 )edit

Building with MinGW-w64 is still a work in progress; we do not currently guarantee that it will work, and do not currently provide any help for those trying to make it work.

Again, I would recommend that you start from scratch, ignore MinGW-w64, and follow the steps given in the Developer's Guide, without skipping steps, adding steps, or changing steps, and install Qt the way I suggested in my answer. I, at least, will not spend any time or energy on providing advice for building with MinGW-w64 until we officially support it, at which point the Developer's Guide should be updated to describe how to set up both Visual Studio and MinGW-w64 builds.

Guy Harris gravatar imageGuy Harris ( 2022-10-13 08:24:29 +0000 )edit

Thank you for your reply.

Build completed successfully.

Qt version difference was the cause of frequent errors.

I learned a lot this time.

Thank you very much. accomplished.

m.kitagawa@tashiro-t.co.jp gravatar image[email protected] ( 2022-10-13 23:36:25 +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: 2022-10-11 00:51:49 +0000

Seen: 2,811 times

Last updated: Oct 14 '22