Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: passerby on October 09, 2008, 08:19:04 pm

Title: Standalone Windows exe - how to build?
Post by: passerby on October 09, 2008, 08:19:04 pm
My program builds and runs fine within C::B, but when I try to run it outside C::B (like any other application), Windows XP says
Code
The application has failed to start because wxmsw28u_gcc.dll was not found. Re-installing the application may fix this problem.
And then the same for wxmsw28u_gcc.dll.
If I put the two files in the same directory where the program resides, it runs fine on the desktop computer.
Putting the same files (my app plus the two dlls) on a laptop results in another "failed to start" message.

How can I build a stand-alone Windows exe?

Thanks in advance.
Title: Re: Standalone Windows exe - how to build?
Post by: jfouche on October 09, 2008, 10:35:24 pm
You can have a look on static link.
Moreover, I suggest you to run depends.exe (Dependency Walker) to know which DLL are missing.
I think it can be mingwm10.dll
--
Jérémie
Title: Re: Standalone Windows exe - how to build?
Post by: passerby on October 09, 2008, 10:48:26 pm
jfouche,
Thanks for responding.
I am not sure what a static link is.
Do you mean that I need to include dlls with my application if I want to run it?
Title: Re: Standalone Windows exe - how to build?
Post by: stahta01 on October 09, 2008, 11:37:24 pm
jfouche,
Thanks for responding.
I am not sure what a static link is.
Do you mean that I need to include dlls with my application if I want to run it?

You are doing Dynamic linking which means you need to include the DLLs you are dynamically linking to unless they are already on the target machine.

Static Linking means instead of linking to outside DLLs you compile the code inside your exe. So, the Libs inside your exe are not needed as DLLs to be included with your app.

Note, none of the above really has to do with Code::Blocks, I suggest getting a beginning C book and reading C and C++ forums for beginning programmers. This forum is NOT for beginning programmers so the people on it do not normally answer simple C/C++ questions.

Tim S
Title: Re: Standalone Windows exe - how to build?
Post by: passerby on October 10, 2008, 08:11:17 am
Tim,
Thank you very much.