Click here to Skip to main content
Sign Up to vote bad
good
See more: C++C
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 20 Jan '13 - 18:18

Comments
Sergey Alexandrovich Kryukov - 21 Jan '13 - 0:28
Not enough information. I provided just the general overview. —SA
Mohibur Rashid - 21 Jan '13 - 2:02
install visual c++ runtime library
Hetal Jariwala - 21 Jan '13 - 3:20
where can i get ite??
merano - 21 Jan '13 - 18:22
Search for Microsoft Redistributable
Mohibur Rashid - 21 Jan '13 - 19:41
search on google, you will download it from microsoft site

2 solutions

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.
  Permalink  
Comments
Hetal Jariwala - 22 Jan '13 - 23:38
So i need to install redistribution project on all pcs???
Hetal Jariwala - 23 Jan '13 - 0:06
It's solved by ur method tnx a lot
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
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 206
1 Richard MacCutchan 145
2 Tadit Dash 140
3 Santhosh G_ 125
4 Volynsky Alex 105
0 Sergey Alexandrovich Kryukov 10,264
1 OriginalGriff 7,957
2 CPallini 4,201
3 Rohan Leuva 3,522
4 Maciej Los 3,155


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid