Page 1 of 1

wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Wed Apr 23, 2014 7:33 pm
by DodoSerebro
Hi,

We have created a project, and I wish to export the exe only to someone who does not have wxWidget nor Code::Blocks 13.12 installed (nor any compiler)

but just wants to test our program (sorta like the .jar file). when I try to run this the .exe found in the Bin > RELEASE folder it gives me this problem

Image

Any help please

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Wed Apr 23, 2014 8:14 pm
by doublemax
You either have to ship the DLLs together with your application or use static linking (SHARED=0 when building both the wxWidgets libraries and your application).

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Sat Oct 03, 2015 1:57 pm
by sly_chandan
I used the following command as per your instructions:

mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 MONOLITHIC=1 RUNTIME_LIBS=static BUILD=release

But now the wxWidgets application isn't compiling.
I get an error at wx/setup.h: no such file or directory.

Am I running the right command???

Please help.

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Tue Oct 06, 2015 7:00 am
by sly_chandan
I solved the dll problem.....

Run the following command:
mingw32-make -j8 -f makefile.gcc BUILD=release SHARED=1 UNICODE=1 VENDOR=custom MONOLITHIC=1

The dll file will be generated......

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Fri Oct 16, 2015 2:06 pm
by evstevemd
sly_chandan wrote:I used the following command as per your instructions:

mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 MONOLITHIC=1 RUNTIME_LIBS=static BUILD=release

But now the wxWidgets application isn't compiling.
I get an error at wx/setup.h: no such file or directory.

Am I running the right command???

Please help.
what is "RUNTIME_LIBS=static" supposed to do? IMHO there is no such flag

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Fri Oct 16, 2015 4:02 pm
by PB
evstevemd wrote:what is "RUNTIME_LIBS=static" supposed to do? IMHO there is no such flag
The flag exists but is not used for GCC:
RUNTIME_LIBS=static
Links static version of C and C++ runtime libraries into the executable, so that the program does not depend on DLLs provided with the compiler (e.g. Visual C++'s msvcrt.dll or Borland's cc3250mt.dll). Caution: Do not use static runtime libraries when building DLL (SHARED=1)!

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Fri Oct 16, 2015 4:43 pm
by evstevemd
PB wrote: The flag exists but is not used for GCC:
I think that explains it. I have never Used MSVC (I hated it the first days I tried to learn VS)

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Sat Oct 17, 2015 4:02 pm
by SSteven
Doublemaxx wrote:
"You either have to ship the DLLs together with your application or use static linking (SHARED=0 when building both the wxWidgets libraries and your application)."

I tried this on my PC. It appears that the exes and the DLLs must be in the same folder. If so, it works. Otherwise, it won't.

Can the configuration be setup so that the DLLs are in 1 folder, but the exes are in separate folders, and can reference the DLLs from the DLL folder? In a typical installation (in my environment), the exes would need to be in multiple folders (related to their respective applications), and would need to access the wx DLLs from the wx DLL folder, and also perhaps other DLLs from other apps. Can such a config be setup and if so, how?

Thanks.
Steven

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Sat Oct 17, 2015 6:47 pm
by PB
I believe that the load-time linked DLLs are pretty much always put in the same folder as the EXE(s). If they are not, the standard search order is used by the Windows to locate them.

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Sat Oct 17, 2015 6:49 pm
by evstevemd
Put dll somewhere and tell installer to add that particular path to the "system path"

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Sat Oct 17, 2015 7:16 pm
by PB
evstevemd wrote:Put dll somewhere and tell installer to add that particular path to the "system path"
Generally speaking, that may not be the best idea with common libraries. You risk that some other application added itself into the %PATH% before you and the Windows may load their version of the library which can have the same name but had been built differently, see the DLL search order in my previous post. You may also look up the term "DLL Hell".

This can be somewhat avoided by naming your wxWidgets DLLs uniquely, e.g. building them with a custom VENDOR (see WXWIN/docs/msw/install.txt). Unless really necessary I would recommend sticking to putting load-time linked DLLs and EXEs to the same directory. It may not be pretty but there is a reason why the applications from MS, Adobe and others are installed this way...

Even the allmighty MS Office has all its applications and DLLs in the single folder and not in separate ones for Word, Excel, PowerPoint and so on. The point is, we are not in the MS DOS era anymore. The user does not need and should not care with what is in the application folder, having to find the executable he wants to launch by himself there: He is supposed to use application shortcuts, be it from the start menu, desktop, pinned on the taskbar...

Re: wxmsw30u_gcc_custom.dll is missing, can't run exe

Posted: Sat Oct 17, 2015 7:26 pm
by evstevemd
@PB
Putting DLL in same dir as exe is the best and standard way. I gave that because op insisted on putting somewhere else. Naming app dlls strangely to avoid dll hell might prodyce false positives if you have Antivirus a la Avira antivir