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

Cannot find winver.h, VS2013 resource compiler

0

I am trying to build wireshark using the instructions in https://www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html. I have followed the instructions carefully. This is a clean windows 7 PC, with just the software needed per the instructions.

The files are building ok up to the point where the Microsoft resource compiler (rx.exe) runs. At this point there is an error message "error RC1015: cannot open include file 'winver.h' It does not appear that the list of include paths presented to rc.exe during the build include the Windows SDK. I cannot find where this list is constructed and then it launches the resource compiler.

I have collected the data you requested and hopefully was able to place the two files on my Google drive. It is difficult to do this at work since our corporate IT firewalls have services like Drive blocked.

cmake.txt https://drive.google.com/file/d/0B2bPJmyYo1uRYnVoVWt3LUhMY21aRmNLSVZBU1F5MlJrcGpV/view?usp=drivesdk

msbuild.txt https://drive.google.com/file/d/0B2bPJmyYo1uRZ3lTMkk0MUxRZHJfR3R4NVcwbGx0UUN5aXVj/view?usp=drivesdk

asked 24 Jul '17, 14:10

eckorsberg2's gravatar image

eckorsberg2
6113
accept rate: 0%

edited 25 Jul '17, 04:47

We need to see to outputs from your build, the CMake configure step and the msbuild step. You can save the outputs by redirecting to a file and then either edit your question with the output, or as it's likely to be large, saving the files on a file sharing service (with no login required) e.g Google Drive, DropBox etc and editing your question with a link to to the shared files.

To redirect the CMake step use:

cmake ... whatever options you used ... 2>&1 > cmake.txt

and for msbuild, it's best to turn off the parallel build:

msbuild /p:Configuration=RelWithDebInfo Wireshark.sln 2>&1 > msbuild.txt
(25 Jul '17, 02:18) grahamb ♦

I have collected the data you requested and hopefully was able to place the two files on my Google drive. It is difficult to do this at work since our corporate IT firewalls have services like Drive blocked.

cmake.txt https://drive.google.com/file/d/0B2bPJmyYo1uRYnVoVWt3LUhMY21aRmNLSVZBU1F5MlJrcGpV/view?usp=drivesdk

msbuild.txt https://drive.google.com/file/d/0B2bPJmyYo1uRZ3lTMkk0MUxRZHJfR3R4NVcwbGx0UUN5aXVj/view?usp=drivesdk

(25 Jul '17, 04:48) eckorsberg2

The output looks good (apart from the build errors).

winver.h should be in C:\Program Files (x86)\Windows Kits\8.1\Include\um and that path should be in the environment variable INCLUDE. Do you have that file, and if so what is the value of that env var?

(25 Jul '17, 05:54) grahamb ♦

Yes I have that file. Originally I did not have the INCLUDE variable set. Then I added C:\Program Files (x86)\Windows Kits\8.1\Include\um to that variable and repeated the process and got the same results.

The problem seems to be that whatever program or script launches the resource compile (rc.exe) it does not include the full path information. Here is a link to what ultimately is executed by msbuild. I don't know where all these include paths come from but it does not include what we need.

https://drive.google.com/file/d/0B2bPJmyYo1uRWHlVSHpoZnB0RnlDc1BVMERtU1BYMDZYQ084/view?usp=drivesdk

(25 Jul '17, 09:00) eckorsberg2

The INCLUDE env var is set by the vs setup batch file that is run when setting up the command line build environment as per Sect 2.2.10 of the WSDG.

Can you confirm you are opening a VS Command Prompt tool to build with?

(25 Jul '17, 09:19) grahamb ♦

Yes I am using the VS Command Prompt to build. I have tried to follow the instructions carefully.
fyi

the tools located in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts

contain this shortcut which I am using VS2013 x64 Cross Tools Command Prompt and that shortcut is actually the below command

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86_amd64

(25 Jul '17, 10:06) eckorsberg2

Why the cross compile? Not that it should make a difference in this case, but I think the native x64 is faster.

You can inspect vcvarsall.bat and see that it calls ...\VC\bin\x86_amd64\vcvarsx86_amd64.bat and that batch file sets the INCLUDE variable. However, the setting of the INCLUDE variable is guarded by a check that the env var WindowsSdkDir is set, and this is set by a call to ...\Common7\Tools\VCVarsQueryRegistry.bat which gets the SDK path from the registry key HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1 in the value InstallationFolder.

So, does your command prompt have an env var WindowsSdkDir and if not, do you have the registry value listed above? If not, it would seem you have a broken install of the 8.1 SDK (as installed by VS).

(25 Jul '17, 11:00) grahamb ♦

Well I downloaded the Windows 8.1 SDK and installed that. Then reran the cmake and msbuild steps but still got the same errors.

These are some of my environment variables that would apply to this build.

VisualStudioVersion=12.0 VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\ VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\ VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 12.0\ WINDIR=C:\Windows WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1\ WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\ WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\ windows_tracing_flags=3 windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log WIRESHARK_BASE_DIR=C:\Development WIRESHARK_CYGWIN_INSTALL_PATH=C:\cygwin64 WIRESHARK_TARGET_PLATFORM=win64

(25 Jul '17, 13:32) eckorsberg2

You haven't shown the INCLUDE var, but please note the pending change 22794 that might be applicable to your issue.

(25 Jul '17, 13:44) grahamb ♦

Here are some additional env variables. Also assuming pending change 22794 is the root of my problem, when shall I know this is completed?

Here is a link to the output of the env command on the VS2013 x64 Native Tools Command Prompt

https://drive.google.com/file/d/0B2bPJmyYo1uRekFLQ05NSWpzWjNZUGp0ekhWV2pISHJzQWFZ/view?usp=drivesdk

(26 Jul '17, 04:10) eckorsberg2

Change 22794 has now been merged to master and the master-2.4 branches, so simply pull all upstream changes into your repo

(26 Jul '17, 04:26) grahamb ♦

Note that I was finally able to rebuild with 1 exception. When I downloaded new sources and followed the proscribed build procedure, I got some cmd.exe error during the command line msbuild procedure. But then I opened the project in the Visual Studio 2013 IDE and built successfully. So in that respect I am ok, but I thought you may still want to know at least I had this issue.

Again I created a clean Windows 7 PC install for this configuration, and tried to follow the instructions to the letter. I think in the process I had to manually add a location to my PATH variable but the details of that was lost during the scramble to get the build working.

(26 Jul '17, 11:06) eckorsberg2

There shouldn't be any errors, there might be some warnings. You can inspect the output of the build slaves here to see how they compile the code.

(26 Jul '17, 11:09) grahamb ♦
showing 5 of 13 show 8 more comments

One Answer:

0

This might be due to us passing /WX to rc.exe: https://code.wireshark.org/review/#/c/22794/

answered 25 Jul '17, 13:46

Gerald%20Combs's gravatar image

Gerald Combs ♦♦
3.3k92258
accept rate: 24%