<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"Arial Unicode MS";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"\@Arial Unicode MS";
        panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1319656036;
        mso-list-type:hybrid;
        mso-list-template-ids:-2130149944 -1647029378 67502083 67502085 67502081 67502083 67502085 67502081 67502083 67502085;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Using CMake and Visual Studio 2010exp to build DLLs for use in Wireshark we are seeing inconsistent results. On all our computers the build verdict is successful. Unfortunately it appears that the DLLs are broken when
built on some computers – the DLLs can not be loaded. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">**** Tool setup ****<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">CMake version: 2.8.7<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Visual Studio Version: 2010 express, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Cygwin and Msys shells<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have compared the build output from a computer that builds working DLLs with the output from a build resulting in broken DLLs.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">**** The build output from the “corrupt” builds: ****<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Manifest:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest" /manifest csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.intermediate.manifest<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> All outputs are up-to-date.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">LinkEmbedManifest:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> All outputs are up-to-date.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> csr_log_proto_ws_1_2_0.vcxproj -> S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.dll<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">FinalizeBuildStatus:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Deleting file "csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.unsuccessfulbuild".<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Touching "csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.lastbuildstate".<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">**** The build output from the “functional” builds: ****<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Manifest:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest" /manifest csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.intermediate.manifest<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest.res" csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0_manifest.rc
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">LinkEmbedManifest:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:QUEUE /OUT:"S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.dll" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib
winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib "..\..\..\..\..\..\tools\wireshark\wireshark-win32-libs\glib\lib\glib-2.0.lib" "..\..\..\..\..\..\tools\wireshark\wireshark-1.2.0\epan\libwireshark.lib" /MANIFEST /ManifestFile:"csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.intermediate.manifest"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.pdb" /SUBSYSTEM:CONSOLE /STACK:"10000000" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"S:/p4/synergy/frw/main/output/vs10/lib/Debug/csr_log_proto_ws_1_2_0.lib"
/MACHINE:X86 /DLL csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.dll.embed.manifest.res<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> "csr_log_proto_ws_1_2_0.dir\Debug\packet-utils.obj"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> csr_log_proto_ws_1_2_0.dir\Debug\csr_proto_plugin.obj<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> "csr_log_proto_ws_1_2_0.dir\Debug\packet-bccmd.obj"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> "csr_log_proto_ws_1_2_0.dir\Debug\packet-bcsp-slip.obj"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> "csr_log_proto_ws_1_2_0.dir\Debug\packet-bcsp.obj"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> "csr_log_proto_ws_1_2_0.dir\Debug\packet-hqcmd.obj" /machine:X86 /debug
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Creating library S:/p4/synergy/frw/main/output/vs10/lib/Debug/csr_log_proto_ws_1_2_0.lib and object S:/p4/synergy/frw/main/output/vs10/lib/Debug/csr_log_proto_ws_1_2_0.exp<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> csr_log_proto_ws_1_2_0.vcxproj -> S:\p4\synergy\frw\main\output\vs10\plugin\Debug\csr_log_proto_ws_1_2_0.dll<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">FinalizeBuildStatus:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Deleting file "csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.unsuccessfulbuild".<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Touching "csr_log_proto_ws_1_2_0.dir\Debug\csr_log_proto_ws_1_2_0.lastbuildstate".<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">**** Steps performed on both computers ****<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Checkout source from our source control server<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Create a new (empty) output directory<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Generate a build system (cmake –G “Visual Studio 10” <path to CMakeLists-file>)<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">Build code (cmake –build .)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Considering that I am performing a completely clean build I am a bit puzzled that the “corrupt” builds reach the conclusion that some part of the build is “up-to-date” in the “manifest” and “LinkEmbedManifest” stages.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We have tried to force a no-parallel build by specifying maxcpucount=1 to VS, but the “corrupt” build still reach the conclusion that some parts are up-to-date and there for skips the resource compiler.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I see the same result building from command line and when building from the IDE. The “corrupt” computer can however produce working DLL’s if the configuration is set to “Release” instead of “Debug” (currently “debug”
is our default configuration)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Currently I have “functional” builds from two different computers and “corrupt” builds from 2 other computers. It should be noted that the two “corrupt” computers can produce functional DLLs with VS2008.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Am I doing something wrong? Is there something that I need to give special attention when building DLL’s with the CMake + VS2010 combination? Is there a CMake option to force the environment to be completely clean during
the build process?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Has anyone encountered similar issues? I understand that this can easily be a Visual Studio issue (configuration and/or use of VS)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am quite puzzled as to why I get working DLLs and corrupt DLLs executing identical operations on different computers. Any guidance will be greatly appreciated.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">We have tried the following setups as well:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">CMake version: 2.8.7<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Visual Studio Version: 2010 express SP1, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">CMake version: 2.8.8<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Visual Studio Version: 2010 express, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">For completeness; the error I get in Wireshark is a pop-up message saying:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Couldn't load module C:\Program Files\Wireshark\plugins\1.2.0\csr_log_proto_ws_1_2_0.dll: `C:\Program Files\Wireshark\plugins\1.2.0\csr_log_proto_ws_1_2_0.dll': The parameter is incorrect.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">And the information from the debugger is:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:8.0pt;font-family:"Courier New"">SXS: RtlCreateActivationContext() failed 0xc000000d<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:8.0pt;font-family:"Courier New"">LDR: LdrpWalkImportDescriptor() failed to probe C:\Program Files\Wireshark\plugins\1.2.0\csr_log_fw_proto_ws_1_2_10.dll for its manifest, ntstatus
0xc000000d<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Casper Madsen<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Senior Engineer, Software<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Cambridge Silicon Radio Ltd.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Niels Jernes Vej 10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">9220 Aalborg Øst<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Denmark<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Tel: +45 99324122</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial Unicode MS","sans-serif"">Fax: +45 99324101<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br><br>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial, Helvetica, sans-serif">Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom<br>More information can be found at <a href=http://www.csr.com>www.csr.com</a>. Follow CSR on Twitter at <a href=http://twitter.com/CSR_PLC>http://twitter.com/CSR_PLC</a> and read our blog at <a href=http://www.csr.com/blog>www.csr.com/blog</a></SPAN>
</body>
</html>