CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual C++ Programming Ask questions about Windows programming with Visual C++ and help others by answering their questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old July 3rd, 2004, 03:44 AM
    Dhiru Dhiru is offline
    Member
     
    Join Date: Jul 2004
    Posts: 29
    Dhiru is an unknown quantity at this point (<10)
    How to convert VC++ project to a distributable exe ???

    Hello ppl

    i am new to vc++, and i would like to know

    How do i convert my VC++ project files to distributable "exe"

    i would like to distribute my software, so how do i get
    an exe, or whatever .

    thankx
    Reply With Quote
      #2    
    Old July 3rd, 2004, 04:56 AM
    hspc's Avatar
    hspc hspc is offline
    Elite Member
     
    Join Date: Apr 2002
    Location: Egypt
    Posts: 2,169
    hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)
    compile the project.
    and use Visual studio installer 1.1 (free from microsoft downloads)
    __________________
    Hesham A. Amin
    My blog , Articles

    Reply With Quote
      #3    
    Old July 3rd, 2004, 06:19 AM
    xperson xperson is offline
    Member
     
    Join Date: Mar 2003
    Location: Bulgaria
    Posts: 25
    xperson is an unknown quantity at this point (<10)
    before you distribute your software, make sure that it's release version (Build->Build Configuration - Release version), otherwise the .exe will not run on other machines, unless they have the debug version of MFC of course (mfc42d.dll).
    __________________
    Courage is no the absence of Fear... it is the presence of fear, but the will to keep going!
    Reply With Quote
      #4    
    Old July 3rd, 2004, 03:17 PM
    JohnCz's Avatar
    JohnCz JohnCz is offline
    Microsoft MVP
    Power Poster
     
    Join Date: May 1999
    Location: DELAWARE, USA
    Posts: 9,674
    JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)JohnCz has a reputation beyond repute (3000+)
    Re: How to convert VC++ project to a distributable exe ???

    Quote:
    Originally posted by Dhiru
    so how do i get
    an exe, or whatever
    Compile and link your project to create executable module (if your app is not a dll).
    As for whatever? I do not know how to get whatever.
    __________________
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

    Warning!
    There's nothing more dangerous than a resourceful idiot.
    Reply With Quote
      #5    
    Old July 4th, 2004, 06:12 AM
    ovidiucucu's Avatar
    ovidiucucu ovidiucucu is offline
    Moderator/Reviewer
    Power Poster
     
    Join Date: Feb 2003
    Location: Iasi - Romania
    Posts: 6,518
    ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)
    Re: Re: How to convert VC++ project to a distributable exe ???

    Quote:
    Originally posted by JohnCz
    As for whatever? I do not know how to get whatever.
    Me also.
    __________________
    Ovidiu Cucu
    Reply With Quote
      #6    
    Old July 9th, 2004, 04:31 AM
    Dhiru Dhiru is offline
    Member
     
    Join Date: Jul 2004
    Posts: 29
    Dhiru is an unknown quantity at this point (<10)
    my vc++ program runs fine and is executing.
    now i want my program to run from any other machine, which
    does not have Visual studio 6.0.

    i want to create a Standalone Application

    i have installed Visual studio Installer 1.1

    what do i do next....


    do i have to use the installer. ( any tutorial to convert VC++ Project). i see a lot of examples using VB.
    Reply With Quote
      #7    
    Old July 9th, 2004, 04:46 AM
    ovidiucucu's Avatar
    ovidiucucu ovidiucucu is offline
    Moderator/Reviewer
    Power Poster
     
    Join Date: Feb 2003
    Location: Iasi - Romania
    Posts: 6,518
    ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)
    It seems that you have a single executable file.
    Just make a release build. It will be "standalone" and you have not to redistribute other runtime libraries as for a VB program.
    __________________
    Ovidiu Cucu
    Reply With Quote
      #8    
    Old July 9th, 2004, 07:50 AM
    Dhiru Dhiru is offline
    Member
     
    Join Date: Jul 2004
    Posts: 29
    Dhiru is an unknown quantity at this point (<10)
    ok now help with this.

    whenever i take my executable say "abc.exe", to some other
    machine it gives me an error...

    ERROR STARTING PROGRAM
    A Required .DLL file, MFC42D.DLL, was not found

    I start with an Empty Intaller Project....

    now what are the files that i should add to this EmptY Installer,
    so that i can have my application running.

    i.e abc.dsp, abc.dsw, abc.exe... any DLL's to put in
    what...?
    i dont know what to do ? i have never used Visual Studio Installer
    before.

    also pls tell me what are the files required from the project, so that my application can anywhere. ( on a machine which does not have Visual Studio Installed) .

    Is it just the EXE that i need to take to the other Machine
    in order to test it.
    cause i got the above mentioned error, when i did that.

    pls help
    thankx

    Last edited by Dhiru; July 9th, 2004 at 07:56 AM.
    Reply With Quote
      #9    
    Old July 9th, 2004, 08:12 AM
    hspc's Avatar
    hspc hspc is offline
    Elite Member
     
    Join Date: Apr 2002
    Location: Egypt
    Posts: 2,169
    hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)hspc is a splendid one to behold (750+)
    Quote:
    Originally posted by Dhiru

    ERROR STARTING PROGRAM
    A Required .DLL file, MFC42D.DLL, was not found
    seems that you use the debug version .. are you sure that you made the release build ?

    MFC42.DLL is available on machines having IE4+ installed.
    __________________
    Hesham A. Amin
    My blog , Articles

    Reply With Quote
      #10    
    Old July 9th, 2004, 08:45 AM
    Ejaz's Avatar
    Ejaz Ejaz is offline
    Super Moderator
    Power Poster
     
    Join Date: Jul 2002
    Location: Lahore, Pakistan
    Posts: 4,116
    Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)
    Quote:

    Originally posted by Dhiru

    ERROR STARTING PROGRAM
    A Required .DLL file, MFC42D.DLL, was not found
    Your project is dynamically linked with the .dlls and when you run it at ur machine, all the .dlls are there, but when u run it to some other machine and not find the necessary .dlls, its start complaining.

    Now, what you can do is, change ur settings and statically link them. Your exeutable size will increase, but will run on the other machines.

    Also, y not you try some distribution software like InstallShield or Inno Setup. Its really great and easy to use.
    Reply With Quote
      #11    
    Old July 9th, 2004, 11:59 AM
    ovidiucucu's Avatar
    ovidiucucu ovidiucucu is offline
    Moderator/Reviewer
    Power Poster
     
    Join Date: Feb 2003
    Location: Iasi - Romania
    Posts: 6,518
    ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)ovidiucucu has a reputation beyond repute (3000+)
    For sure you have built the debug version (see what hspc have posted).
    So, select "Build\SetActive configuration" menu item and choose "<your proj. name> - Win32 Release" from the list. Then, rebuild the project.
    It's not needed to statically link the MFC libraries.
    __________________
    Ovidiu Cucu
    Reply With Quote
      #12    
    Old July 10th, 2004, 01:42 AM
    Dhiru Dhiru is offline
    Member
     
    Join Date: Jul 2004
    Posts: 29
    Dhiru is an unknown quantity at this point (<10)
    thankx to all of u ppl for the help.

    anyways, now i made the changes.
    Build->Set ActiveConfiguration->W32 Release... i get the following errors....

    abc.obj : error LNK2001: unresolved external symbol _WNetCloseEnum@4
    abc.obj : error LNK2001: unresolved external symbol _WNetOpenEnumA@20
    abc.obj : error LNK2001: unresolved external symbol _WNetEnumResourceA@16
    ServInfo.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
    ServInfo.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4
    Release/abc.exe : fatal error LNK1120: 5 unresolved externals
    Error executing link.exe.


    i dont seem to get these errors if the configuration is set to Debug .

    what am i supposed to do.

    and one more thing, is there any book which will give me all the details.
    Reply With Quote
      #13    
    Old July 10th, 2004, 04:41 AM
    voonnalk voonnalk is offline
    Junior Member
     
    Join Date: Jun 2004
    Posts: 15
    voonnalk is an unknown quantity at this point (<10)
    For Distributed EXE

    Hi,
    Actually in VB there is one Tool like Package And Deployment to distribute ur EXE..It will Create the Setup Program...

    Similarly For VC++ there is InstallShield program to build like Setup Program...
    There will be help file how to do follow steps..
    Please Go through it...
    U can Install with MSVisual Studio 6.0

    With regards..
    Kumar
    Reply With Quote
      #14    
    Old July 10th, 2004, 05:08 AM
    Ejaz's Avatar
    Ejaz Ejaz is offline
    Super Moderator
    Power Poster
     
    Join Date: Jul 2002
    Location: Lahore, Pakistan
    Posts: 4,116
    Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)Ejaz has a reputation beyond repute (3000+)
    Quote:

    abc.obj : error LNK2001: unresolved external symbol _WNetCloseEnum@4
    abc.obj : error LNK2001: unresolved external symbol _WNetOpenEnumA@20
    abc.obj : error LNK2001: unresolved external symbol _WNetEnumResourceA@16
    ServInfo.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
    ServInfo.obj : error LNK2001: unresolved external symbol __imp__gethostbyname@4
    Release/abc.exe : fatal error LNK1120: 5 unresolved externals
    Error executing link.exe.
    link your project with mpr.lib and Ws2_32.lib
    Reply With Quote
      #15    
    Old July 10th, 2004, 05:43 AM
    Dhiru Dhiru is offline
    Member
     
    Join Date: Jul 2004
    Posts: 29
    Dhiru is an unknown quantity at this point (<10)
    even though i make my application a "W32 Release"
    i still get the following error, when i execute my exe
    on some other PC.

    A Required .DLL, MFC42D.DLL, was not found.

    what do i need to do so that my exe runs anywhere.

    i also tried to link all DLL's Statically,
    but i still get the error.

    I dont get any error on my PC
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Visual C++ Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 03:44 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009