C++ Basic Question

This is a discussion on C++ Basic Question within the C++ Programming forums, part of the General Programming Boards category; How can I take a project I made in Visual C++ Express and allow it to run on someone else's ...

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    75

    Exclamation C++ Basic Question

    How can I take a project I made in Visual C++ Express and allow it to run on someone else's computer. I can get the exe to run on my computer but not on someone elses. I also tried doing a release build which did not work. I get an error saying Side by Side Configuration is Incorrect.

    Thanks

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    118
    Quote Originally Posted by MaGaIn View Post
    How can I take a project I made in Visual C++ Express and allow it to run on someone else's computer. I can get the exe to run on my computer but not on someone elses. I also tried doing a release build which did not work. I get an error saying Side by Side Configuration is Incorrect.

    Thanks
    A few things if you have BUILT the program, with an executable output:
    1. You need the same architecture. If your using 32 bit windows, they can't have 64 bit.
    2. You need to have the same operating system. If you made it in windows, they can't run it on linux (well, you can, but let's not get into that)

    I can't say I know exactly whats going on, because I use Code::Blocks.

    FlyingIsFun1217

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    Did you create a Win32 Console Application? Did you link to the static runtime library or a dll? Is .NET or CLI enabled for your project? The most common cause of this type of issue depends on the answers to those questions. For example, if you didn't use a Win32 Console Application, VC++ might be trying to include CLI stuff in your program, then complaining when you don't have that stuff on the other machine. Or, if you linked to the runtime library dll, then perhaps the other machine is missing that dll.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by FlyingIsFun1217 View Post
    1. You need the same architecture. If your using 32 bit windows, they can't have 64 bit.
    Yes, they can. MS made a huge effort to make 32-bit "legacy" apps as compatible as possible with the 64-bit OS, to the point where you can largely mix 64-bit and 32-bit libraries and executables. The WoW64 layer does the translation.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    I have a C++ console application and I am attempting both on Windows XP. I am unsure about what you mean with the dll and static runtime library. Please explain further

    Thanks

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    In the project options, there is an option that allows you to link to the runtime library in different ways. For the release build, you'll probably have Single Threaded DLL, Single Threaded, Multi-Threaded DLL, or Multi-Threaded. I don't have VC++ in front of me at the moment so those might not be exact, but the point is that if you have the one with DLL, then the other machine must have the msvcrt80.dll file available. Some older machines don't, so you will get errors.

    The solution in that case might be to link to the version that is not a DLL. Then the library will be linked into your executable. That will make the exe bigger, but then you won't have to copy the msvcrt80.dll file with it.

    If you are already linking to the non-DLL version, then this isn't your problem. Look in the project options for another option that says whether to enable Common Language Interface or Common Language Runtime or something like that. If you find it, turn it off. Then rebuild your exe and try the new exe on the second computer.

  7. #7
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    Thanks for the help can anyone be more specific how to do this bc i am confused

    Thanks

  8. #8
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    Did you find the options? Did you look?

    The CLR option is General > Use Managed Extensions and should be set to No.

    The runtime library option is C/C++ > Code Generation > Runtime Library and should be either Single-threaded (/ML) or Multi-threaded (/MT).
    Last edited by Daved; 09-17-2007 at 07:12 PM.

  9. #9
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    Quote Originally Posted by Daved View Post
    Did you find the options? Did you look?

    The CLR option is General > Use Managed Extensions and should be set to No..
    I was unable to find this option I found Configuration Properties > General but I did not find use managed extensions.

    Thanks.

  10. #10
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    In VC++ Express the option is called Common Language Runtime Support (which is pretty close to what I guessed earlier).

    You're probably going to have to do some digging and thinking on your own to figure this out. I'm just explaining common problems that sound similar to the little information that you've given.

    BTW, you said you have a C++ Console Application. I don't see that option for new projects, I see only CLR Console Application and Win32 Console Application. As I mentioned earlier, you probably want the Win32 Console Application. If you did create a CLR Console Application, then I'd create a new project that is a Win32 Console Application and copy the code to it. There might be other settings that aren't how you want them if you kept the current configuration.

  11. #11
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    It works now. Thanks for your help.

  12. #12
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    Was it the CLR Console Application thing?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A basic math programming question
    By hebali in forum C Programming
    Replies: 38
    Last Post: 02-25-2008, 04:18 PM
  2. Basic question about GSL ODE func RK4
    By cosmich in forum Game Programming
    Replies: 1
    Last Post: 05-07-2007, 03:27 AM
  3. Basic question about RK4
    By cosmich in forum C++ Programming
    Replies: 0
    Last Post: 05-07-2007, 03:24 AM
  4. A very basic question
    By AshFooYoung in forum C Programming
    Replies: 8
    Last Post: 10-07-2001, 04:37 PM

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