Note that there are some explanatory texts on larger screens.

plurals
  1. POBuild VC++ project on x64, unable to execute on x86
    primarykey
    data
    text
    <p>I have an unmanaged VC++ project that I can build for both x86 and x64 targets. It is being consumed by a .NET program that is compiled for Any CPU. This is on VS2010, but I had the same issue when the solution was built with VS2008 and vcbuild.</p> <p>Here is the build command in my build script:</p> <pre><code>msbuild .\Project.vcxproj /t:Build /p:PlatformToolset=v100 /p:Configuration=Release /p:Platform=%platform% </code></pre> <p>If build on an x86 machine, with %platform%=Win32, everything builds and executes fine</p> <p>If build on an x64 machine, with %platform%=x64, everything builds and executes fine.</p> <p>However, if I build on an x64 machine, with %platform%=Win32, it builds successfully with no errors. But when I copy those supposedly-x86 binaries to an x86 machine, they cause the following error:</p> <pre><code>System.Runtime.InteropServices.SEHException was caught Message=External component has thrown an exception. </code></pre> <p>Tracing that error back to the C++ dll, it failed on this line:</p> <pre><code>if ( FAILED( g_Connection.CreateInstance( _T("ADODB.Connection") ) ) ) ThrowException(_T("Cannot create connection.")); </code></pre> <p>I've gone through my .vcxproj file looking for issues but everything appears correct. There are no imported property files or custom build tasks or anything like that. </p> <p>This is causing issues because we are trying to use a single x64 build server to create builds for both platforms. Our current workaround involves pre-building the C++ dll on two different machines. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload