wxmsw30u_gcc_custom.dll is missing, can't run exe Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
DodoSerebro
In need of some credit
In need of some credit
Posts: 1
Joined: Sun Apr 06, 2014 1:40 pm

wxmsw30u_gcc_custom.dll is missing, can't run exe

Post 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
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post 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).
Use the source, Luke!
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

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

Post 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.
sly_chandan
Earned some good credits
Earned some good credits
Posts: 116
Joined: Fri Sep 25, 2015 2:33 pm

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

Post 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......
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

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

Post 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
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

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

Post 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)!
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

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

Post 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)
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
SSteven
Earned a small fee
Earned a small fee
Posts: 15
Joined: Fri Sep 04, 2015 7:03 am

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

Post 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
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

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

Post 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.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

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

Post by evstevemd »

Put dll somewhere and tell installer to add that particular path to the "system path"
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

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

Post 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...
Last edited by PB on Sat Oct 17, 2015 7:35 pm, edited 2 times in total.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

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

Post 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
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply