Error in distributing .exe online

This is a discussion on Error in distributing .exe online within the C++ Programming forums, part of the General Programming Boards category; Hello fellow forum members, I have been working on a simple program that just takes in an input and outputs ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    5

    Exclamation Error in distributing .exe online

    Hello fellow forum members,

    I have been working on a simple program that just takes in an input and outputs some data. I have been distributing the .exe online. It is a simple black box program with no GUI that only uses the iostream header file.

    This program is compiled with Visual C++ 2008 and works fine on my computer as well as some people online who have Visual C++ online. (I'm using windows XP SP2).

    However a couple of people online who also have Windows XP are complaining about error messages that would not allow them to run the program:

    Activation context generation failed for "C:\Users\~~~~\Desktop\DC subbed episode list.exe". Dependent Assembly Microsoft.VC80.DebugCRT,processorArchitecture="x86 ",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",v ersion="8.0.50608.0" could not be found. Please use sxstrace.exe for detailed diagnosis


    I have been looking online for a solution, but have not found one.

    Can anyone please tell me how to make my .exe file distributable on all Windows systems?

    Thanks in Advance

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Make a release version of your program. You're currently compiling in debug mode and trying to distribute that.

    You may still have to distribute the VC8 CRT, though. VC++ should contains a redistributable installer for that.
    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

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,791
    That binary seems compiled against the debug runtime which AFAIK is illegal to restiribute. Compile against release runtime first.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    5
    Thanks for the quick responses, but how do I make a release version in VC++.

    Also, does Microsoft hold some patents on my software for compiling it with them? Will they steal my code?

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    >> how do I make a release version in VC++.
    Change the configuration to Release instead of Debug. It should be under the Build menu somewhere.

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Even then it is necessary to distribute the VC80 release runtime DLL with your file to ensure it works. Most computers probably have the VC70 runtime on them but few will have the VC80.

    This is also true with using and registering DLLs on other computers. If your DLL relies on VC80 and it is not installed, regsvr32 will fail to register the DLL complaining that the module could not be found. Your event viewer will yield more info and let you know that a dependency was not found.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by GamesSmash View Post
    Also, does Microsoft hold some patents on my software for compiling it with them? Will they steal my code?
    1) You can't hold patents on code. You can only hold copyright. You hold copyright by writing the code, or by paying someone to write the code for you.

    2) How did you ever get this absurd idea?
    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

  8. #8
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,791
    Quote Originally Posted by GamesSmash View Post
    Also, does Microsoft hold some patents on my software for compiling it with them? Will they steal my code?
    Lol, what an absurd idea.
    Anyway, create a setup project and distribute your app with it. In case you don't want a setup project, do one anyway and copy the vcredist*.exe in your setup folder. It's the one file that will install the runtime on the computer of whomever you want to run it.

  9. #9
    Registered User
    Join Date
    Nov 2007
    Posts
    5
    Is it possible to make my program run without VC80 and use VC70 instead?

  10. #10
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,791
    Use an older compiler/IDE then.
    But nevertheless, most people don't tend to have runtime for VC2002+ since it's not bundled with Windows XP and many programs just put the runtime (prior to 2005 anyway) in their local directory.

  11. #11
    Registered User
    Join Date
    Nov 2007
    Posts
    5
    Quote Originally Posted by Bubba View Post
    Even then it is necessary to distribute the VC80 release runtime DLL with your file to ensure it works. Most computers probably have the VC70 runtime on them but few will have the VC80.
    I still don't understand. How do I distribute the DLL in the same .exe file without having to distribute more files?

    Sorry for all the questions

  12. #12
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Try linking against the standard library statically. It's in the project options.
    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

  13. #13
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,791
    Quote Originally Posted by GamesSmash View Post
    I still don't understand. How do I distribute the DLL in the same .exe file without having to distribute more files?

    Sorry for all the questions
    You can do this, but it will increase your file size drastically. On the contrary, you only need to install the runtime once, and all your apps will work later. Your must install the runtime in this case, but only once.
    If you statically link against the libraries, the filesize will increase and you'll have to do it all the time.
    As I mentioned, create a setup project and distribute all the files in the setup folder. Or just statically link. Up to you.

  14. #14
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    MSVS Setup and Deployment wizards will do most of the work for you.

    If you have MSVS just create a setup and deployment project from within your existing project. Project - > Add project -> Setup and Deployment.

    It will figure out the dependencies for you and install the correct DLLs inside of the setup script it generates.

  15. #15
    Registered User
    Join Date
    Nov 2007
    Posts
    5
    It works!

    Thanks for all the help everyone!

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 12-09-2008, 10:09 AM
  2. 2D Spaceship shooter online - Need 2 keen programmers
    By drallstars in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 05-19-2005, 07:40 AM

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