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

fatal error C1189: #error : Your MSVC_VARIANT setting in config.nmake doesn’t match the MS compiler version!

0

Hello guys.

I got some faults, which i described above in the title. I know that i have to change the MSVC_VARIANT in the config.nmake, but nothing helped. I'm doing the steps like described in the developer-guide of wireshark. I had a lot of issues and a lot of troubleshooting too. Another problem is, that i just want to change the $(FrameworkSdkDir) from v7.0A to v7.1. I use the MS Visual Studio EE 2010, but i cant change this value. I was coding the dissector example, want to compile it and create a dll. But i earn a lot of issues. I'm real tired of them. Can anyone give me a tip or something else? That would be so fine.

Greetings

asked 25 Jun '13, 04:16

bprogrammer's gravatar image

bprogrammer
16115
accept rate: 0%

edited 25 Jun '13, 04:24


One Answer:

2

The usual answer is that you must follow the instructions in the Developers Guide to the letter. Any deviation may lead to issues.

If you are using VS EE 2010, you should set MSVC_VARIANT=MSVC2010EE and ensure all the other versions are commented out.

What is the $(FrameworkSdkDir) you refer to and why do you think you need to change it? You should try to build Wireshark as per the instructions with no changes at all, and only when you succeed at that can you go ahead and modify things.

answered 25 Jun '13, 04:38

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Hello,

thanks for the quick answer. Yes, i'm sure that I commented the other versons out. Hm, i think i have to install the "Microsoft SDK v7.1" ?. When I install die VS EE 2010 it installs the Microsoft SDK v7.0A by itself. So, i thought i have to change this path to this --> C:\Programme\Microsoft SDKs\Windows\v7.1.

Is that the wrong way?

Thanks..

(25 Jun '13, 04:49) bprogrammer

Your answer has been converted to a comment as that's how this site works. Please read the FAQ for more information.

Unless you planned changes require something in the Windows API that is introduced by the SDK 7.1 then there is no need to change. My current build env also uses VS 2010 EE and in the command prompt used to compile I have the following env vars:

ComSpec=C:\WINDOWS\system32\cmd.exe CYGWIN=nodosfilewarning DevEnvDir=C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ FP_NO_HOST_CHECK=NO Framework35Version=v3.5 FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework\ FrameworkDIR32=C:\WINDOWS\Microsoft.NET\Framework\ FrameworkVersion=v4.0.30319 FrameworkVersion32=v4.0.30319 INCLUDE=C:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE;C:\Program Files\Microsoft SDKs\Windows\v7.0A\include; LIB=C:\Program Files\Microsoft Visual Studio 10.0\VC\LIB;C:\Program Files\Microsoft SDKs\Windows\v7.0A\lib; LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\Program Files\Microsoft Visual Studio 10.0\VC\LIB; NUMBER_OF_PROCESSORS=4 OS=Windows_NT Path=C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN;C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework\v3.5;C:\Program Files\Microsoft Visual Studio 10.0\VC\VCPackages;C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools;C:\ProgramFiles\Microsoft SDKs\Windows\v7.0A\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\CMake 2.8\bin;C:\Program Files\TortoiseSVN\bin PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1 PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 6 Model 42 Stepping 7, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=2a07 ProgramFiles=C:\Program Files PROMPT=$P$G PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\ SESSIONNAME=Console SVN_SSH="C:\Program Files\PuTTY\plink.exe" SystemDrive=C: SystemRoot=C:\WINDOWS VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 10.0\VC\ VS100COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\ VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 10.0\ windir=C:\WINDOWS WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v7.0A\

(25 Jun '13, 05:03) grahamb ♦

Okay, i can see that you are using the SDK version v7.0A. I tried some things and read some passages of the developer-guide.pdf again. So, i got some questions again. The document describes i should prepare my cmd.exe. Sounds great. In my case i will insert in the cmd: "C:\Programme\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /Release /x86

But, v7.0A has not a "SetEnv.cmd". Next step, the describe: "If your version of the compiler does not have SetEnv.Cmd, you may need to use vcvarsall.bat or vcvars32.bat which do much the same thing as SetEnv.cmd."

I haven't vcvarsall.bat and also no vcvars32.bat?!

Thanks for your patience.

(26 Jun '13, 00:25) bprogrammer
1

As explained in Sect 2.2.6 of the Developers Guide, vcvarsall and vcvars come from Visual Studio. The Guide lists the path for a 64 bit OS with VS 2010.

I believe that SDK v7.0A gets installed as part of VS 2010 and is a cut-down version, hence the the lack of a SetEnv.

If you go digging in the start menu you'll find a 'Visual Studio Command Prompt (2010)' under the Visual Studio entry and a 'Windows SDK 7.1 Command Prompt' under the SDK entry. If you have installed the x64 bits (or have an x64 OS) you'll probably have x64 versions of the prompts as well. These prompts are what I use rather than typing the path in an ordinary command prompt.

(26 Jun '13, 00:49) grahamb ♦

Yesterday, i have reinstalled all Components(MSVC10EE,WINSDK7,MSVC Service Pack1 and the SP1 Compiler Setup). I guess something was wrong of the cygwin installation (the packages). Now, i can build my packet-foo.c.. It was a really nice hint to use the Command Prompt's. Thanks..

However, now i get some issues by starting wireshark. I copied the .dll in the "wireshark\wireshark-gtk2\plugins" directory. The errormessage is that the wiretap-1.11.dll is missing. So, i copied the wireshark.exe in the wireshark-gtk2 directory and it works. Seems like a ugly fix..

Is there another way? If i copy my builded .dll in the "normal" Wireshark i get the fault, that this dll(1.11.myProtocoll.dll) is missing.

Greetings

(02 Jul '13, 00:40) bprogrammer
1

You get the error because your newly built plugin dll is linked to the wiretap-1.11 dll as you've built your dll from a copy of the main trunk.

If you're using svn to get the Wireshark sources, either switch to the trunk-1.10 branch (svn switch ...) or checkout a copy of that branch. If you're using git you'll have to do the git equivalent whatever magic that is,

If you're using a source package grab the one for 1.10.

This is a drawback of a privately maintained plugin, you'll need to build a copy for each distributed version of Wireshark your users have, e.g. 1.8, 1.10 etc.

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(02 Jul '13, 02:09) grahamb ♦

Thanks a lot.. You're great. =)

(10 Jul '13, 02:00) bprogrammer
showing 5 of 7 show 2 more comments