Click to See Complete Forum and Search --> : How to convert VC++ project to a distributable exe ???
Dhiru
July 3rd, 2004, 03:44 AM
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
hspc
July 3rd, 2004, 04:56 AM
compile the project.
and use Visual studio installer 1.1 (free from microsoft downloads)
xperson
July 3rd, 2004, 06:19 AM
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).
JohnCz
July 3rd, 2004, 03:17 PM
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.
ovidiucucu
July 4th, 2004, 06:12 AM
Originally posted by JohnCz
As for whatever? I do not know how to get whatever.
Me also. :) :D
Dhiru
July 9th, 2004, 04:31 AM
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.
ovidiucucu
July 9th, 2004, 04:46 AM
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.
Dhiru
July 9th, 2004, 07:50 AM
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
hspc
July 9th, 2004, 08:12 AM
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.
Ejaz
July 9th, 2004, 08:45 AM
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 (http://www.jrsoftware.org/isinfo.php). Its really great and easy to use.
ovidiucucu
July 9th, 2004, 11:59 AM
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.
Dhiru
July 10th, 2004, 01:42 AM
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.
voonnalk
July 10th, 2004, 04:41 AM
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
Ejaz
July 10th, 2004, 05:08 AM
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
Dhiru
July 10th, 2004, 05:43 AM
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
Tischnoetentoet
July 10th, 2004, 05:47 AM
is there a windows 95 on that other machine???
voonnalk
July 10th, 2004, 06:11 AM
Hi,
Install "InstallShield" which is with Visual Studio 6.o......
After that you can setup ur program...
Otherwise it will ask necessary dlls when u r running ur exe....
With Regards..
Dhiru
July 10th, 2004, 06:59 AM
No there is no Win 95 on the ohter machine
the other machines have Win 98,XP,2000.
is there a way to distribute this DLL along so that
i dont get this error.
thanks kumar, for the InstallShield suggestion.
i have installed it. i'll try it out.
by the way what 's the output file extension...
like the one by visual studio installer i get a .msi file.
gstercken
July 10th, 2004, 07:20 AM
Originally posted by Dhiru
is there a way to distribute this DLL along so that
i dont get this error.This is not a deployment problem - you should definitely not distribute MFC42D.DLL to the target machine, as it's the debug version of the MFC runtime library. It's not only technically nonsense to do that, but also prohibited by MS license agreements - for short, it's illegal.
You should rather find out why your executable still wants to load MFC42D.DLL - if you really made a release build, this should not be the case (it should try to load MFC42.DLL, which is already present on virtually every recent PC running Windows). Moreover, if you have really linked MFC statically, your executable should require no DLL at all. So go back and check your compiler and linker settings for your project. Note that under Project/Settings, you can choose different settings for the various configurations. So if you need to link to a lib and added it to the linker settings for the debug build, make sure you also add it for the release build. As for the RT library: Check your compiler settings (C/C++, category "Code Generation"). Make sure the release build configuration doesn't use a debug version of the runtime library, but the corresponding release version. Also make sure under "Preprocessor" that NDEBUG is #defined, and not _DEBUG.
And just another thing (just to exclude that arcane possibility): When you make a release build, make sure to take the generated executable from the correct target directory (Release, not Debug).
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.