Click here to Skip to main content
11,629,614 members (75,145 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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:18pm
Comments
Sergey Alexandrovich Kryukov at 21-Jan-13 0:28am
   
Not enough information. I provided just the general overview.
—SA
Mohibur Rashid at 21-Jan-13 2:02am
   
install visual c++ runtime library
Hetal Jariwala at 21-Jan-13 3:20am
   
where can i get ite??
merano at 21-Jan-13 18:22pm
   
Search for Microsoft Redistributable
Mohibur Rashid at 21-Jan-13 19:41pm
   
search on google, you will download it from microsoft site
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 at 22-Jan-13 23:38pm
   
So i need to install redistribution project on all pcs???
Hetal Jariwala at 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)

  Print Answers RSS


Advertise | Privacy | Mobile
Web03 | 2.8.150723.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100