Posted By: David7738 | Apr 18th, 2008 @ 11:33 PM
page 1 of 1
Comments: 11 | Views: 1553
wrote a console application c++ program using VS2008. It is nothing more than a "Hello World". I copied the .exe to a flash drive and then onto another XP computer. When I try to execute it says "This application has failed to start because the application configuration is incorrect". So then I tried copying it over using MSN and when I execute it now says "Windows cannot access the specified deivce, path or file. You many not have the appropriate permissions to access the item.

I have administrator privledges so I should be able to execute it.

Any ideas?
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

The error is a side-by-side configuration error. More details can be found in the event log.

It is highly likely that this message refers to the Visual C++ runtime library. You can solve this by installing the Visual C++ 2008 redistributable package on the target machine, or by placing the files from C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT (including the manifest file!) in the same directory as the executable.

CannotResolveSymbol
CannotResolveSymbol
{insert caption here}
Managed or unmanaged?  If managed, make sure .Net's installed.  If unmanaged, make sure you've got the VC++ 2008 redistributable installed.

The error would indicate the latter, I believe.

(crap, Sven beat me to it Tongue Out)
Actually, I'm willing to bet you compiled a debug version.  Compile in release, and I bet it works.  If not, then yes, you need the redistributable runtime.
Pace
Pace
In The Mix...
Pardon my ignorance. I thought the whole point of c++ was that it is platform independant?

Is this because its something to do with VS that you have to have the redist? Can you make a platform independant app in vs? Am I making senses ? Perplexed

Sorry im not trying to pick holes, im trying to further my understanding Wink
All versions of C/C++ have a runtime library that contains the standard functions. With gcc is libc, which ships by default on Linux, with Visual Studio is the VC Runtime, which doesn't ship by default with Windows.

The existentence of the standard libraries doesn't alter the portability of the language itself.
CannotResolveSymbol
CannotResolveSymbol
{insert caption here}
Pace wrote:
Pardon my ignorance. I thought the whole point of c++ was that it is platform independant?

Is this because its something to do with VS that you have to have the redist? Can you make a platform independant app in vs? Am I making senses ? Perplexed

Sorry im not trying to pick holes, im trying to further my understanding Wink


It's also worth noting that compiled C++ code is *never* platform independent...  any platform independence in C++ is purely at the source level.  It's not like Java or .Net where you can write and compile it once and run it on any platform that has the runtime.
ZippyV
ZippyV
Fired Up
AndyC wrote:
All versions of C/C++ have a runtime library that contains the standard functions. With gcc is libc, which ships by default on Linux, with Visual Studio is the VC Runtime, which doesn't ship by default with Windows.

Then how come the Windows applications can run without the runtime?
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
ZippyV wrote:
Then how come the Windows applications can run without the runtime?

Windows wasn't written in VS2008, so that particular runtime isn't included.

You can also statically link the CRT, which integrates it into your executable.

EDIT: I just checked, Windows Server 2008 does include the VC2005 runtime (and I think the VC2008 one as well, although that may have been installed by something else)
Differing versions of Windows may or may not ship with various VC runtimes to support the apps shipped with them. However they are not guaranteed to be there between versions, or even builds and if your application relies on them, it is your responsibilty to install them as part of your installation. The same goes for MFC.
evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
Pace wrote:
Pardon my ignorance. I thought the whole point of c++ was that it is platform independant?

Is this because its something to do with VS that you have to have the redist? Can you make a platform independant app in vs? Am I making senses ? Perplexed

Sorry im not trying to pick holes, im trying to further my understanding Wink


Yes, you can make platform independent apps with VS, although you might have to extract it from the PE header if you want to migrate the app to a non-Windows platform.
page 1 of 1
Comments: 11 | Views: 1553
Microsoft Communities