|
First, you have to tell us which IDE you used to compile (VC6, VC2005, ...). Things are different dependending on the IDE you used.
To find which dll needs to be distributed with your app, open the dependency walker (the program is normally supplied with the IDE but you can find it easily on the web also). It will show you all the dll that your app requires.
Also, do not distribute debug version of your program (and dll). This is not legal (particularly for distributing the debug version of the microsoft dll's).
|
|
|
|
|
Thank you.
I have used visual studio 6.0 IDE
|
|
|
|
|
In additional I remember that we have an example in MSDN that it shows all files that your program use of their.
|
|
|
|
|
tejaswini.g wrote: when I tried to run the exe file I got the error saying that there is no MFC42D.DLL , c:\WINNT\system32;..........
As it says, you need to ship all required dlls on target machine. For detecting required dlls, you can use MS visual studio tool depends.
|
|
|
|
|
Thank you.
Can u plz say is there any method to create an installation file with all the required files to run an application successfully.
|
|
|
|
|
you need to create set up. One of method is using InstallShield.
If you are using VC 7.0 +.Then you can use wizardv to create set up.
|
|
|
|
|
Thnak you prasad.
I am using vc++ 6.0 . Can u plz say how to create setup .
Thanks in advance.
|
|
|
|
|
|
Thank you prasad, it's very much useful for me.
|
|
|
|
|
tejaswini.g wrote: I took the exe file and placed in another system in which there is no visual studio software.when I tried to run the exe file I got the error saying that there is no MFC42D.DLL , c:\WINNT\system32;..........
This means your exe is dependent on these modules. You exe will need these dlls to run. So you will have to ship the corresponding dlls with your exe.
You can use dependency walker to find out what all dlls your exe is dependent on.
|
|
|
|
|
Thank you.
Sorry ,I don't know how to use dependency walker.
Can u say how to use dependency walker.
|
|
|
|
|
tejaswini.g wrote: Sorry ,I don't know how to use dependency walker.
Can u say how to use dependency walker.
Goto Start->Run
Type "depends" without quotes. This will open dependency walker. Now open your exe and see the listing of dlls on which your exe is dependent.
Or
Right click on your exe and select "View dependencies". You will see this if you have dependency walker installed.
|
|
|
|
|
Thanks alot.
I got it.
Thanks all of you once again.
|
|
|
|
|
|
the other guys already answered. but i see one important thing though.
don't distribute a program compiled in debug mode ! compile in release mode to deliver it...
then, for each DLL missing, find them on your computer and provide them with your exe.
|
|
|
|
|
-Go to your project
-Press ALT+ f7
-In General tab from Microsoft foundation classes Select "Use MFC in Static Library" then compile your prj again
|
|
|
|
|
the best way to have huge exes...
|
|
|
|
|
Not necessarily true:
MFC DLL contains all the MFC code, while linking the static LIB will cause only the required OBJ module to be included in the EXE.
In general the sum of the "small" exe and the DLL exceed the one of the "long" exe.
Then, it depends on how many MFC classes are directly or indirectly used and how many MFC depending exe-s are supposed to be on the target system.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
tejaswini.g wrote: How can I rectify this problem and run the exe file.
Compile in release mode. You cannot redistribute the debug version of the DLLs.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I've small piece of code,My query is , why line in bold not work ?
int main(int argc, char* argv[])
{
char *pp=new char[2];
char c='I';
char *str="test";
strcpy(pp,"dynamic");
pp[0]=c;
cout<<pp<<endl;
str[0]=c;
delete []pp;
return 0;
}
-- modified at 6:56 Tuesday 12th September, 2006
|
|
|
|
|
Because you do not know where the compiler placed the string "test".
What you did with that one was telling the compiler to give you the adress of "test". That means, the compiler has to find a location to place "test" in. And that might, following the C++-Standard, be anywhere, even locations that are not writeable from inside the code.
You should not make any assumptions on where the compiler places this. You need to assign memory to the char*, then copy "test" into the char*, in order for this to work.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Ok.Thanks.
I was in assumption that,
char* str="test";
cout<<str[0]<<endl;
is possible , then reverse is also possible.
Thanks.
|
|
|
|
|
Because *str is a pointer to a string constant "test", and not an array of characters.
The pointer *str can be made to point to a different location, but the contents of a string constant cannot be changed (the ANSI C Standard actually says trying to modify the contents of string constant is undefined - ie. sometimes it might work, other times it may not - so you should never be writing code like this)
Writing the following would work because str would be an array of characters. The contents of the array could be changed, but str will always refer to the same storage.
chat str[] = "test";
str[0] = c;
|
|
|
|
|
|
prasad_som wrote: char *str="test";
prasad_som wrote: I've small piece of code,My query is , why line in bold not work ?
Because compiler places these type of strings in read only memory area.
|
|
|
|