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; I am having the same problem running Visual C++ 2005 Express Edition.. Can anyone explain how to link the files ...

  1. #16
    Registered User
    Join Date
    Nov 2007
    Posts
    4

    Exclamation Same Problem

    I am having the same problem running Visual C++ 2005 Express Edition.. Can anyone explain how to link the files together? .exe File size doesnt matter.
    Thanks in Advance.

  2. #17
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,543
    Right-click project -> Properties -> General -> Use of MFC -> Use MFC in a Static Library.
    I strongly discourage you from doing it, however. With every additional program you send, all that code will be included which will increase filesize. If you install the runtime, it's done only once and your app needn't include the MFC code.

  3. #18
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Express doesn't have MFC.

    It's Properties->General->Standard Libraries or something like that. Still, Static Library is the correct choice for that dropdown.
    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

  4. #19
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by CornedBee View Post
    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.
    Whilst I agree on the copyright, I also, unfortunately, have to disagree about the statement of "you can't hold patents on code" - there is certainly patents on code in many places. It is pretty specific code, admittedly.

    Case in point: Register allocation in compiler:
    http://www.freepatentsonline.com/20070022413.html

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #20
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,632
    Whilst I agree on the copyright, I also, unfortunately, have to disagree about the statement of "you can't hold patents on code" - there is certainly patents on code in many places. It is pretty specific code, admittedly.
    The patent is not on the code, but on the method that the code implements. The code is under copyright, the method is patented.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #21
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by laserlight View Post
    The patent is not on the code, but on the method that the code implements. The code is under copyright, the method is patented.
    Ok, there is a semantic difference, but the outcome of a lawsuit is still the same - if you implement the method described in the patent, you will be liable to the patent holder. Even if you didn't know the patent existed when you wrote such code [unless you wrote it BEFORE the patent was filed, in which case you have a case of "prior art"].

    Patents, in this case, has a much higher capability of preventing someone from creating "code that does the same thing" than copyright - the latter only prevents you from copying the exact code or the exact look-and-feel of an application, whilst the patent will prevent you from implementing the same functionality.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #22
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,632
    Ok, there is a semantic difference, but the outcome of a lawsuit is still the same - if you implement the method described in the patent, you will be liable to the patent holder.
    If it were merely under copyright and you implement the method described, you will not be liable for copyright infringement, unless your implementation copied the code. So I think the semantic difference is a real difference: the outcome of a lawsuit can be different if the method was not patented.
    Last edited by laserlight; 11-26-2007 at 03:45 AM. Reason: will -> can
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #23
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by laserlight View Post
    If it were merely under copyright and you implement the method described, you will not be liable for copyright infringement, unless your implementation copied the code. So I think the semantic difference is a real difference: the outcome of a lawsuit will be different if the method was not patented.
    Ok, we're missing each others point: My point was that there's a semantic difference between patenting a method and patenting the code that implements the method [the latter is, as you correctly stated, not what is done - mostly because that would just require someone to write it in a differnet language, or use slightly different variables to "break" the patent]. You took that to mean, I think, that there is a small difference between copyright and patents - there is a HUGE difference - both in the (supposed) criteria for acceptance and for "breaking" patents vs. copyright. Copyright is for the whole material produced, and is implicit - you only need to prove that you were the author/creator of something to "win" a copyright infringement trial. In patents, you have to register the patent (and it should go through an approvals process), and in general, it applies only to small portions of the overall code [the register allocator may be an IMPORTANT part in a compiler, but it's far from the bulk of the code - probably only a few hundred or thousand lines in a million lines of code overall for the compiler]. Patents are very explicit [although as loosely formulated as possible, to capture the essence of the idea, rather than the specifics]. Copyright applies to ALL of the creators work.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #24
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Patents and copyright are completely different things. You patent inventions. You have a copyright on the concrete, tangible results of your work.

    Program code cannot ever be under a patent - not just that it isn't worth it, but it's not possible. A piece of code is not an invention. It's just a tangible result of your work, and thus copyrighted.
    A special type of cook pot that keeps its contents under pressure, thus increasing the boiling temperature of water and making the food be ready faster, that's an invention. It's not tangible, though: no copyright.
    The shiny designer pot we have at home is not an invention. It's a concrete implementation of the invention above. Its design is subject to copyright.
    In the US, an algorithm for encrypting data with a special key such that a different key is needed to decrypt it, with it being mathematically possible, but practically effectively infeasible to get from one key to the other, is an invention. It's also patented. In Europe, it's not, because algorithms are not acknowledged as inventions, or at least not as patentable.
    OpenPGP and GnuPG contain implementations of the algorithm. They can't be patented; however, they are under copyright.
    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

  10. #25
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    Quote Originally Posted by Elysia View Post
    I strongly discourage you from doing it, however. With every additional program you send, all that code will be included which will increase filesize. If you install the runtime, it's done only once and your app needn't include the MFC code.
    Other then filesize is there any other reason for discouraging me from including the MFC code? I'm writing just a basic black box code, its not that big anyways. And it is being distributed to a large variety of comps, with various operating systems.

  11. #26
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    MFC may not work correctly on other platforms. But then again neither does .NET so I reckon your outta luck there too.

  12. #27
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,543
    Quote Originally Posted by Twoie View Post
    Other then filesize is there any other reason for discouraging me from including the MFC code? I'm writing just a basic black box code, its not that big anyways. And it is being distributed to a large variety of comps, with various operating systems.
    Other than filesize... no, none that I can think of.
    But you can create a setup to install your app for you and you don't have to worry about installing the runtime yourself.
    For every app you create, you include the big runtime. So... if you build two apps, you pass them two runtimes. If the runtime is 3 MB and your app is 100 KB, then it's 3 * 2 + 100 * 2 = 6.2 MB instead of 3 + 0.2 = 3.2 MB. Basic math, and that's why I don't recommend static linking.

    Once the runtime is installed, you never again have to worry about it.

  13. #28
    Registered User
    Join Date
    Nov 2007
    Posts
    4

    Setup to install app

    Quote Originally Posted by Elysia View Post
    But you can create a setup to install your app for you and you don't have to worry about installing the runtime yourself.
    Mind explaining to me how to create a setup to install my app? I'm really new to all this.
    I'm using Visual C++ 2005 Express Edition
    using #include "stdafx.h"
    #include <iostream>
    #include <fstream>
    #include <iomanip>

    What you are saying makes total sense.

  14. #29
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,543
    OK, so a simple tutorial - you'll have to refer to docs to customize it. I don't know everything about setup projects either. Anyway, here goes:

    Right-click the solution and select add project. Select Setup and Deplay -> Setup project and create it.
    In the left pane, you'll see system that says "File System on Target Machine" and underneath a lot of folders.
    Click on Application Folder. This is where setup will put your application & any necessary dlls/files to run the program. It's the directory the user chooses during setup.
    Right-click in the right pane and select add -> project output.
    Select your project in the combobox where it says project. In the list below, select Primary Output, which says that the EXE or DLL of that project will be used. And lastly, select Release from the configuration combobox. This tells setup you want to use the Release version of your EXEs/DLLs (because Debug versions won't work on the target machine!).
    Click OK and repeat the process for any other files from projects you want to add. You can also select add -> file or folder to include misc files.
    Now you can right-click your setup project and select properties. Here you can set misc parameters such as how to store the files and how to optimize the setup package.
    Click prerequisities. Here you can select what runtime your application needs to run. IF you're just doing a normal C/C++ app (not .NET), then scroll down and select Visual C++ Runtime Libraries. Make sure the checkbox above the list is checked and click OK to accept.
    The final step is simply to build the setup project. Bundle all the files in the output folder for the setup project to the target machine and run setup and it should do the rest.

    You can play around a little with it as well.

  15. #30
    Registered User
    Join Date
    Nov 2007
    Posts
    4
    Quote Originally Posted by Elysia View Post
    OK, so a simple tutorial - you'll have to refer to docs to customize it. I don't know everything about setup projects either. Anyway, here goes:

    Right-click the solution and select add project. Select Setup and Deplay -> Setup project and create it.
    In the left pane, you'll see system that says "File System on Target Machine" and underneath a lot of folders.
    Click on Application Folder. This is where setup will put your application & any necessary dlls/files to run the program. It's the directory the user chooses during setup.
    Right-click in the right pane and select add -> project output.
    Select your project in the combobox where it says project. In the list below, select Primary Output, which says that the EXE or DLL of that project will be used. And lastly, select Release from the configuration combobox. This tells setup you want to use the Release version of your EXEs/DLLs (because Debug versions won't work on the target machine!).
    Click OK and repeat the process for any other files from projects you want to add. You can also select add -> file or folder to include misc files.
    Now you can right-click your setup project and select properties. Here you can set misc parameters such as how to store the files and how to optimize the setup package.
    Click prerequisities. Here you can select what runtime your application needs to run. IF you're just doing a normal C/C++ app (not .NET), then scroll down and select Visual C++ Runtime Libraries. Make sure the checkbox above the list is checked and click OK to accept.
    The final step is simply to build the setup project. Bundle all the files in the output folder for the setup project to the target machine and run setup and it should do the rest.

    You can play around a little with it as well.
    Ok what program are you using because mine doesnt have setup and deploy......when I right click and go to Add.. My options are new item, existing item, new filter and class......And none of them hold Setup and Deploy in them......May I should use another program, or something.

Page 2 of 3 FirstFirst 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