Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
we have a legacy software with using c++ dlls and now we r trying to build it again in visual studio but it is not running on pcs where visual studio is not installed.
What is reason for this??
Posted
Comments
Sergey Alexandrovich Kryukov 21-Jan-13 0:28am    
Not enough information. I provided just the general overview.
—SA
Mohibur Rashid 21-Jan-13 2:02am    
install visual c++ runtime library
Hetal Jariwala 21-Jan-13 3:20am    
where can i get ite??
merano 21-Jan-13 18:22pm    
Search for Microsoft Redistributable
Mohibur Rashid 21-Jan-13 19:41pm    
search on google, you will download it from microsoft site

You can write portable C++ code, but you cannot make an executable module multi-platform for native-code C++ project. Executable files have different formats for different platforms; there are many of them, and even if the CPU instruction-set architecture is the same, OS calls are linked into it. And if the CPU instruction-set architecture is different, you code may very likely crash/hang if the target is different from the CPU you try to use during run-time.

Of course, Visual Studio is not required to use the compiled code, but some C++ solutions will need "Visual Studio redistributable package". The installations are available free of charge from Microsoft for each version of Visual Studio. Please find the one you need in MSDN.

You really need to learn how code is built, loaded and executed; the whole lifetime cycle.

It does not hold for C++/CLI. If you write pure CLI code and do it very accurately, in a perfectly portable manner, you can get code running on many different OS without recompilation. It includes different versions of Window, Linux, Mac OS X, iOS and more. On non-Microsoft platforms, it requires Mono, on Microsoft it could be either .NET or Mono.

Sorry, I'm not providing any references, as I don't know if you are interested in CLI or not. You can very easily find them in Wikipedia and Microsoft documentation, or ask some follow-up questions.

—SA
 
Share this answer
 
v2
This is a problem I have run into several times, with 2 main causes.

If the 'other' PCs do not have the redistribution package for that version of the compiler, your code might not run. There is a separate package for each version of Visual Studio (ie. VS6, VS.Net2002, VS.Net2003, VS2005, VS2008, VS2010, VS2012...).

If you build your targets with "Debug" settings and ship the targets to other machines, those 'other' machines will not be able to run your code unless they either have the same Visual Studio compiler installed or you have manually installed the debug DLLs for that compiler. Note that the redistribution package is only available in Release form. The debug DLLs are not licensed for redistribution.
 
Share this answer
 
Comments
Hetal Jariwala 22-Jan-13 23:38pm    
So i need to install redistribution project on all pcs???
Hetal Jariwala 23-Jan-13 0:06am    
It's solved by ur method tnx a lot

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