1

I am trying to cross-compile the following hello-world program

#include <iostream>

int main()
{
    std::cout << "Hello world!" << std::endl;
}

My host platform uses Microsoft Visual Studio Express 2012 for Windows Desktop on a Windows 7 SP1 64-bit machine. My target platform is a 32 bit Windows XP Embedded device (Version 2002 Service Pack 2) with 248 MB of RAM. I follow the command line instructions at http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx to do the cross-compilation.

The fact that I can successfully run my hello_world.exe in the 'IE6 on XP' virtual machine from https://dev.windows.com/en-us/microsoft-edge/tools/vms/windows/ makes me feel confident that the cross-compiling went fine. However, when I copy the hello_world.exe to my Windows XP Embedded device and try to run it, I get the following Application Error:

enter image description here

Dependency Walker (running on the XP Embedded device) does not show me any DLL problems:

enter image description here enter image description here

I am stuck here. If anybody can shed a light on why I am getting this strange Application Error and how I can fix it, I would be happy to hear!

Community
  • 1
  • 1

1 Answers1

1

Problem solved. The problem was that the CPU of the embedded device did not support certain instructions. I was compiling my hello_world program without the /arch option, but for Visual Studio 2012 that means that SSE2 instructions are enabled. Compiling my hello_world program with the /arch:IA32 option solves the problem.