Author Topic: Standalone Windows exe - how to build?  (Read 5665 times)

Offline passerby

  • Single posting newcomer
  • *
  • Posts: 8
Standalone Windows exe - how to build?
« 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.

Offline jfouche

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: Standalone Windows exe - how to build?
« Reply #1 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

Offline passerby

  • Single posting newcomer
  • *
  • Posts: 8
Re: Standalone Windows exe - how to build?
« Reply #2 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7787
    • My Best Post
Re: Standalone Windows exe - how to build?
« Reply #3 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
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline passerby

  • Single posting newcomer
  • *
  • Posts: 8
Re: Standalone Windows exe - how to build?
« Reply #4 on: October 10, 2008, 08:11:17 am »
Tim,
Thank you very much.