Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi bro.
I'm design a software in Windows7 x64.
But when I'm copping it to windows x86 (windows 7, and windows xp)
It thow the error in the picture below

http://imageshack.com/a/img31/1282/dxe4.png[^]

ps: I was setup the Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

Do you have any way to software can run for all x64 and x86 flatfrom ?
Posted
Updated 15-Feb-14 17:24pm
v2
Comments
Sergey Alexandrovich Kryukov 15-Feb-14 23:41pm    
Are you talking about C++ projects? And not C++/CLI?
—SA

1 solution

With C++ or any other native-code technology, the only way to develop software which runs on different platforms would be development of separate versions for each of the supported instruction-set architectures. Also, note that there is no a single 64-bit architecture. There are x86-64 and IE64 (Itanium). There are different and incompatible with each other:
http://en.wikipedia.org/wiki/X86[^],
http://en.wikipedia.org/wiki/X86-64[^],
http://en.wikipedia.org/wiki/Itanium[^].

At the same time, you can compile all code to x86-32. It will be compatible with all the systems and will be run under WoW64 on Windows:
http://en.wikipedia.org/wiki/WoW64[^].

All software components loaded in the same process should be compiled to the same architecture; you cannot combine then even if each of them separately is compatible with the target system.

If you develop separate versions of all the software component for the architectures you want to support, if you want, you can integrate then in a single package that would behave as architecture-agnostic. For example, you can create a startup module compiled to x86-32 (to be executed on WoW64 on 64-bit platform). It can detect the target CPU architecture and start the application process using executable module(s) compiled exactly for this architecture.

That was about native-code architecture. If you want to develop using .NET (you could do it using C++/CLI dialect of C++, which is standardized under ECMA-327), you can use the target "pseudo-architecture" called "AnyCPU". Such architecture is possible because you compile the code into IL code, which is additionally compiled to CPU instructions using JIT compilation. Please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://en.wikipedia.org/wiki/Just-in-time_compilation[^],
http://en.wikipedia.org/wiki/Common_Language_Infrastructure[^],
http://en.wikipedia.org/wiki/Common_Language_Runtime[^].

—SA
 
Share this answer
 
v2
Comments
thatraja 17-Feb-14 3:08am    
5!
Sergey Alexandrovich Kryukov 17-Feb-14 11:41am    
Thank you, Raja.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900