cross compiling using visual studio 2005 - visual-studio

I compiled a x64 application in win32 development environment.. When I run that binary in 64 bit intel machine , the following error is displayed
"The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail."..
In the event log it is mentioned that
"Activation context generation failed for . Dependent Assembly icrosoft.VC80.DebugCRT,processorArchitecture="amd64",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0" could not be found. Please use sxstrace.exe for detailed diagnosis.
What is this issue and how to resolve this problem ?and architecture of the target system is amd64.
C:\>set | findstr /i amd64
PROCESSOR_ARCHITECTURE=AMD64

The error indicates, that you are trying to run a debug build on a machine that has no debug C runtime installed. The debug runtime is not redistributable, so your current application will only run on a machine with VS2005 installed.
To fix this issue, change the build flavour from Debug to Release and try again.
You also need to make sure, the lates C runtime libraries are available on the target machine. This page holds the lates VS2005 redistributable runtime installers for all supportet target platforms .

Related

Could not launch gdb from Visual Studio for remote debugging Linux C++ project in Linux subsystem on Windows

I am trying out Targeting the Windows Subsystem for Linux from Visual Studio. The project builds fine in Visual Studio:
1>------ Rebuild All started: Project: LinuxConsoleApp, Configuration: Debug x64 ------
1>Cleaning remote project directory
1>Validating architecture
1>Validating sources
1>Copying sources remotely to 'localhost'
1>Starting remote build
1>Compiling sources:
1>main.cpp
1>Linking objects
1>LinuxConsoleApp.vcxproj -> C:\...\LinuxConsoleApp\bin\x64\Debug\LinuxConsoleApp.out
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
I can run it from the bash commandline prompt on Windows:
linux#windows-bash:/mnt/c/.../LinuxConsoleApp/bin/x64/Debug$ ./LinuxConsoleApp.out
hello from LinuxConsoleApp!
However, when I set a breakpoint to debug it from Visual Studio, I got error:
"Could not launch gdb. gdb is missing from your system and needs to be
installed, please use your system's package manager to install it"
I did install gdbserver on the Linux subsystem on Windows. Does anyone know what else I need to make it work? Thanks in advance!
Firstly, have you installed gdb on WSL? What does command gdb --version display?
Then recommend you debug in gdb mode, see this topic for details.
And, if you read the comments in the original Visual Studio blog about using WSL, you will see that there are some issues around ssh which, if you follow the trail, will take you to this fix

Linking errors with boost, VS2010, and CMake

I have searched high and low for this answer. I have tried suggestions to similar problems posted on Stack and other sites. My toolchain consists of an x64 machine with windows 7, visual studio 2010, opencv 2.4, qt 4.8, and boost. I configure all of my projects using CMake, which finds all of these libraries and includes and creates my visual studio project. I have compiled two versions of boost, a 32-bit version build in the command line and placed in \boost\boost_1_47_0\lib\win32, and a 64-bit compiled in the Windows SDK v7.1 64-bit compiler and stored in \boost\boost_1_47_0\lib\x64. Everything in the project compiles fine with the exception of boost. I get a compiler error:
fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-1_47.lib'
As a reminder, CMake is handling all of my linking and it properly locates this lib and adds it to the visual studio project. I can verify this by looking at Properties->Linker->Command Line. Here, in addition to files representing other libraries, it has listed:
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_filesystem-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_program_options-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_date_time-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_thread-vc100-mt-1_47.lib"
I can suppress this error by manually adding my boost\boost_1_47_0\lib\x64 directory to Properties->Linker->General->Additional Library Dependencies. This compiles without error. However, when I go to run the application, I am met with a system error that tells me:
The program can't start because boost_filesystem-vc100-mt-1_47.dll is missing from your computer. Try reinstalling the program to fix this problem.
In this /x64 directory I have:
boost_filesystem-vc100-mt-1_47.dll
boost_filesystem-vc100-mt-1_47.lib
libboost_filesystem-vc-100-mt-1_47.dll
Any insight would be incredibly appreciated. Thanks!
To solve the runtime error:
Add the location of the dll(s) to the PATH environment variable.
For example on my machine:
set PATH=%PATH%;c:\users\chris\boost_regex-vc140.1.63.0.0\lib\native\address-model-32\lib
or copy the dll(s) to a directory already in the PATH
See here: https://msdn.microsoft.com/en-us/library/7d83bc18.aspx?f=255&MSPPError=-2147217396

Boost library error in Windows 7 64-bit

I have correctly compiled Boost for Windows 8 with VS-10 as given in this link. My project works fine. But when I copy the project to another Windows 7 machine it returns an error message as "The application was unable to start correctly (0xc000007b). Click OK to close this application.". I have correctly installed Boost in the second PC as well. Both PCs are 64-bit and I installed 32-bit Boost in both. As I found from some links this is because the project try dynamically linking 64-bit libraries instead 32-bit. Could you kindly advice how to build this as a portable solution. Thanks in advance.
Update 1:
Following is the dependency walker output.
Are you sure you selected the Visual Studio 2010 Command Prompt x86 to compile the library? or the x64 version? there is more than 1 version of the command prompt in the start menu. my guess would be that you accidentally ran the x64 version, and then compiled boost with it, resulting in a x64 bit version of the library compiled.
Here's a batch file that compiles the static and shared version of boost in x86:
compileboost.bat:
call "%vs110comntools%..\..\VC\vcvarsall.bat" x86
cd C:/boostsourcefolder/
call bootstrap.bat
.\b2 runtime-link=static
.\b2 runtime-link=shared
Then in your VS2010 project properties, Common Properties -> VC++ Directories -> Include Directories, type your boost folder (C:/boostsourcefolder/). and in Common Properties -> VC++ Directories -> Library Directories, type the boost compiled library folder (C:/boostsourcefolder/stage/lib/).
That's pretty much all you need to do.

Visual Studio Project "Release" (x86) build can not load a DLL (msobj100.dll)

I have a really simple project that I am trying to build with Visual Studio 2010 Express (x64) edition (C++). It contains only 1 file (main.cpp) that is used to find the machine epsilon on my machine and does nothing else. When I try to compile a Debug x86 build everything works fine and an .exe is generated but I would like to make a release build as I need to turn this code is as a HW assignment. When I try and compile a Release (x86) build it fails with the following error -
1>LINK : fatal error LNK1296: unable to load msobj100.dll
I ran a search and the only place I found a file called msobj100.dll is in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64" so I tried adding that location to the solution's VC Directories -> Executable Directories line. It didn't work. Why does the Release build complain about this DLL when the Debug build does not? I have compared both build pages and can not seem to find any differences in their dependencies or directory locations. I would really like to know what is going on. Thanks!
You're trying to load the 64-bit DLL in your x86 application, you can probably find msobj100.dll in C:\Windows\SysWow64

Building a winform app in VS for windows 7 x64 - get an error on install

I have a winform application that i desiged in VS2005 that works fine in windows 7 x86 however when i try to install it on x64 I get the error:
"You have to run the 64-bit version of DPinst.exe on this machine. Contact the vendor that provided you this package. "
In VS I have the build set to 'Any CPU' which should handle 64bit. I cant seem to find much on that error online, any ideas? Is it something i need to change in VS before the build?
http://download.microsoft.com/download/5/d/6/5d6eaf2b-7ddf-476b-93dc-7cf0072878e6/32-64bit_install.docx

Resources