Thread: "side-by-side configuration is incorrect"

  1. #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.

  2. #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.

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    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

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    A common problem. It means you haven't installed the VC++ runtime. Naturally, the software suite itself installs this runtime.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #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.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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?".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    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.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

    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.
    Last edited by VirtualAce; 02-09-2010 at 07:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. placing two bmp images side by side
    By nina_code in forum C++ Programming
    Replies: 2
    Last Post: 07-14-2009, 11:10 AM
  2. Doxygen failing
    By Elysia in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 04-16-2008, 01:24 PM
  3. OpenGL example cube is black, white, grey only
    By edwardtisdale in forum Windows Programming
    Replies: 7
    Last Post: 09-22-2007, 02:37 PM
  4. Strange side effects?
    By _Elixia_ in forum C Programming
    Replies: 4
    Last Post: 08-16-2005, 03:25 PM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM