C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-07-2010, 11:32 PM   #1
Registered User
 
Sharke's Avatar
 
Join Date: Jun 2008
Location: NYC
Posts: 303
"side-by-side configuration is incorrect"

Some time ago I wrote a small program in C to help me prepare the invoices for my business. I've been using it successfully for about a year now. It's an executable which I start from the command line, giving a directory path as an argument. Never once have I had any problems. About three months ago I installed Windows 7, no problems at all.

However just recently I've reinstalled Windows 7, have done nothing differently yet when I try to start the program as before, I get a "the application has failed to start because its side-by-side configuration is incorrect" error.

Can anyone tell me, in simple "layman" terms (I can knock out simple programs in C but don't know much about systems) why this might be happening and how I can fix it? The program was compiled with Visual C++ Express, which I don't have installed in my new OS installation yet. Could this be the problem? I did think of this but then again I didn't install it on my last install of Windows 7 and yet my program worked fine.
Sharke is offline   Reply With Quote
Old 02-07-2010, 11:59 PM   #2
Registered User
 
Sharke's Avatar
 
Join Date: Jun 2008
Location: NYC
Posts: 303
Well I guess I installed VC++ and now it's working. Problem solved! I do however wonder why it worked before with no VC++. Oh well.
Sharke is offline   Reply With Quote
Old 02-08-2010, 01:13 AM   #3
train spotter
 
Join Date: Aug 2001
Location: near a computer
Posts: 3,501
Sounds like your app is using the libraries (DLLs) dynamically linked (loaded at runtime) rather than staticly linked (built in).

Until you installed MSVC the correct DLL was not found, causing the app to fail (exact reason was probably in the event viewer).

I assume that means any Win7 machine without MSVC will not run your app.
__________________
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche

"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best

"If you are going through hell....keep going."
Winston Churchill
novacain is offline   Reply With Quote
Old 02-08-2010, 03:54 AM   #4
Mysterious C++ User
 
Elysia's Avatar
 
Join Date: Oct 2007
Posts: 16,078
A common problem. It means you haven't installed the VC++ runtime. Naturally, the software suite itself installs this runtime.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2010 Ultimate, C++0x
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
"Thanks for all your help. It's obvious yall really know what you're talking about when it comes to OOP/C++ stuff."
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 02-08-2010, 07:23 AM   #5
Registered User
 
Sharke's Avatar
 
Join Date: Jun 2008
Location: NYC
Posts: 303
Is there a way I can recompile my program without such dependencies, so that it can be run on a machine without VC++? Also I'm a little confused as to why it worked fine on my first install of Windows 7, which also had no VC++ installation.
Sharke is offline   Reply With Quote
Old 02-08-2010, 07:29 AM   #6
Mysterious C++ User
 
Elysia's Avatar
 
Join Date: Oct 2007
Posts: 16,078
I would claim that you should not do such a thing. The runtime should be installed on every machine. There is a good chance many machines already have it installed because professional software uses VC++ and thus have installed it already.
It's just a one-time install. Putting all dependencies into the EXE will bloat the size.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2010 Ultimate, C++0x
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
"Thanks for all your help. It's obvious yall really know what you're talking about when it comes to OOP/C++ stuff."
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 02-08-2010, 11:47 PM   #7
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 8,322
Quote:
It's just a one-time install. Putting all dependencies into the EXE will bloat the size.
Eh? Your setup and deployment program can handle this. It dependency walks the code and automatically brings in the runtimes as dependencies. During setup it will install them in <install path>/System32/WinSxs with the folder name representing the version of the CRT. It has nothing to do with the EXE except that the EXE is dependency walked to determine what it needs to run.

This problem occurs a lot when people fail to provide proper installation programs to allow the user to install their application. Windows is telling you it cannot find the CRT. In past times MSVCRT.DLL was used by all C/C++ executables. However as of MSVC 2005 and beyond Microsoft changed all of that and now MSVCRT is no longer used in the same fashion. Now EXEs link with the DLLs found in the WinSxS folder in your System32 folder.

Incidentally if you look at your event viewer you will find the side by side error in the applications error list. If you double click this it will tell you everything you need to know.
__________________
I remember when The Weather Channel talked about weather, MTV played music videos, and the History Channel talked about history instead of conspiracy theories.
Bubba is offline   Reply With Quote
Old 02-09-2010, 03:29 AM   #8
C++ Witch
 
laserlight's Avatar
 
Join Date: Oct 2003
Location: Singapore
Posts: 12,460
Quote:
Originally Posted by Bubba
Eh? Your setup and deployment program can handle this. It dependency walks the code and automatically brings in the runtimes as dependencies. During setup it will install them in <install path>/System32/WinSxs with the folder name representing the version of the CRT.
I think Elysia is cautioning against statically linking the dependencies, and by talking about installing them for setup and deployment, you have implied the same despite the "eh?".
__________________
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar

Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
laserlight is online now   Reply With Quote
Old 02-09-2010, 05:19 AM   #9
Mysterious C++ User
 
Elysia's Avatar
 
Join Date: Oct 2007
Posts: 16,078
What laserlight said is true.
Quote:
Originally Posted by Bubba View Post
...However as of MSVC 2005 and beyond Microsoft changed all of that and now MSVCRT is no longer used in the same fashion. Now EXEs link with the DLLs found in the WinSxS folder in your System32 folder...
Yes, they made this in order to make it easier to service the application, they said. However, they're going back to the old pre-2005 model with 2010.
__________________
Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2010 Ultimate, C++0x
"Thanks Elysia. You're a programming master! How the hell do you know every thing?"
"Thanks for all your help. It's obvious yall really know what you're talking about when it comes to OOP/C++ stuff."
Quoted... at least once.
Quote:
Originally Posted by cpjust
If C++ is 2 steps forward from C, then I'd say Java is 1 step forward and 2 steps back.
Elysia is offline   Reply With Quote
Old 02-09-2010, 07:25 PM   #10
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 8,322
Quote:
Yes, they made this in order to make it easier to service the application, they said. However, they're going back to the old pre-2005 model with 2010.
Typical. Now that we get everything running and working with the side by side stuff they go and change it again. Can someone over there please make up their minds? How are they going to version the CRT if they are just going to allow all of the code to link with one MSVCRT? I actually like the new way of doing it even though it takes some getting used to.

Quote:
I think Elysia is cautioning against statically linking the dependencies, and by talking about installing them for setup and deployment, you have implied the same despite the "eh?".
I see that now and it makes more sense after reading Elysia's post a few more times.
__________________
I remember when The Weather Channel talked about weather, MTV played music videos, and the History Channel talked about history instead of conspiracy theories.

Last edited by Bubba; 02-09-2010 at 07:27 PM.
Bubba is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
placing two bmp images side by side nina_code C++ Programming 2 07-14-2009 11:10 AM
Doxygen failing Elysia General Discussions 19 04-16-2008 01:24 PM
OpenGL example cube is black, white, grey only edwardtisdale Windows Programming 7 09-22-2007 02:37 PM
Strange side effects? _Elixia_ C Programming 4 08-16-2005 03:25 PM
Serial Communications in C ExDigit Windows Programming 7 01-09-2002 10:52 AM


All times are GMT -6. The time now is 12:17 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22