Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
i am building a simple mfc dialog based project with visual studio 2005/2008
that program works on some machines and on some others it gives side by side error.

if i build the same project in some other computer that program works on all the
machines ..including the machines which it was not working ..
Posted
Comments
Estys 23-Jan-11 5:20am    
Removed your "Answer" and added it as comment to the answerer.

This is a very un-informative error which means the required CRT or MFC run-times aren't installed on the computer.

Either change the project to:
If you are using MFC, change Project>Properties>General>Use of MFC to Use MFC in a Static Library, otherwise leave it as Use Standard Windows Liraries
AND
Set the Project>Properties>C/C++>Code Generation>Runtime Library to not have DLL in the name so it uses static linking

or, get the run-times for your version of MFC and visual studio from MSDN.
Visual Studio 2008 x86[^]
Visual Studio 2005 SP1 x86[^]
To find the others (including x64) just google "Visual Studio redist"

EDIT:
Just to clarify, the runtimes are to be installed on the computer you are running it on, with the same platform that the .exe you are trying to run (i.e. a Win32 .exe will need the x86 redist, even if it is running on a x64 computer).
 
Share this answer
 
v2
Comments
Estys 23-Jan-11 5:19am    
@Andrew Brock : Added comment from OP given as an answer.

From Rajesh Katalkar :

but the program works on the computer where it was not working
without any modification if built on some other machine
Rajesh Katalkar :
but the program works on the computer where it was not working
without any modification if built on some other machine


This still supports my answer. The following will be happening in a situation like this:
Build computer A compiled the project with Visual Studio W, which has MFC X
Build computer B compiled the project with Visual Studio Y, which has MFC Z

This means that the project requires different versions of the Visual Studio Redistributable files.
So, the computer you were testing the project on may only have the redistributable files required by Build computer B, meaning the project will only work if it was compiled from that computer.

You can verify by what I am saying by grabbing a copy of Dependancy Walker[^] and opening the executable file. This will show the DLL files required for the program to run. There will be files named something like MSVCRT, MSVCR, MSVCM, ATL, MFC, ...
All these files will have a version number in the name, and can be found in the Side-by-Side directory C:\Windows\WinSxS (SxS = Side-by-Side)

If you run Dependancy Walker on the build computer it will find all the required DLLs, if you run it on a computer that shows the error message, it will show an error message saying that it couldn't find all the dependencies.

Both solutions from my previous answer will correct this problem will correct it.
 
Share this answer
 

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