What is the best way to get wxwidgets for your app in a system that doesn't have it 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.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by Mamo_Grag17 »

Hello, i built an application, and it works well, but my question now is if the application's user doesn't have wxwidgets in the system, the application won't work.
In linux, i can download the library from the package manager, but for windows !! There is no package manager that has wxwidgets, please any idea of how to get this work ?
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by doublemax »

Are you talking about a user that just wants to execute your application?

Under Windows you can link everything statically and create a totally self contained executable that runs without any dependencies.

Or you can create an installer that installs all needed DLLs, etc.
https://jrsoftware.org/isinfo.php
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by ONEEYEMAN »

Hi,
Have a question for you: did you build any DLL that is needed to run the application or you software consist of 1 big binary file?
If the latter - you can build wxWidgets for static linking and just distribute the application as one binary file. Just put it somewhere on your website or on the web and promote it.
If you have DLL that has to be shipped with you binary - you can create an installer. Take a look at InnoSetup.

But even for *nix you don't provide the source code.
You need to create a deb/rpm file which will know how to build your software and that's what you will distribute to the world.

Those rpm/deb file will have set of rules that will instruct the appropriate package manager, what you used to build the software (dependencies) and where to get them.
It will also have the rules that will build your application and install it on user system.

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by ONEEYEMAN »

Also, keep in mind that depending on what compiler did you use you might not have a choice and just create he installer anyway.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by Mamo_Grag17 »

doublemax wrote: Wed May 25, 2022 9:00 pm Are you talking about a user that just wants to execute your application?
Well, now i have an installer, and it will install the application but what I don't know is how does the application will work for the user without wxWidgets !!
doublemax wrote: Wed May 25, 2022 9:00 pm Or you can create an installer that installs all needed DLLs, etc.
https://jrsoftware.org/isinfo.php
That's what i want now, i know about inno setup but I don't know how to install the DLLs and link them to my application whenever it will be executed.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by Mamo_Grag17 »

Thank you for responding,
ONEEYEMAN wrote: Wed May 25, 2022 9:02 pm If the latter - you can build wxWidgets for static linking and just distribute the application as one binary file. Just put it somewhere on your website or on the web and promote it.
So if i built wxwidgets with static linking, then build the executable, i can upload the executable to somewhere and that's it ?
I will no longer need wxwidgets on the user system ?

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by doublemax »

Mamo_Grag17 wrote: Thu May 26, 2022 8:41 am So if i built wxwidgets with static linking, then build the executable, i can upload the executable to somewhere and that's it ?
I will no longer need wxwidgets on the user system ?
Yes. The only thing left to consider are the C runtimes of the compiler (CRT). You need to link those statically, too. How to do that depends on the compiler you're using, there are either GUI settings (Visual C++) or command line switches (MinGW) for it.

You'll have to rebuild wxWidgets with these CRT settings, too.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by ONEEYEMAN »

Hi,
Also, while MSVC CRT might already be installed on the end user system, MinGW one most likely not.
So you will either need to link it statically or create an installer with InnoSetup.

Thank you.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by Mamo_Grag17 »

Thank you, now i will use inno setup, but i am just curious, how to link my application with wxwidgets as DLL library.

I want to know just in case i built another application.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by doublemax »

Mamo_Grag17 wrote: Thu May 26, 2022 12:33 pm Thank you, now i will use inno setup, but i am just curious, how to link my application with wxwidgets as DLL library.
In that case you'll have to ship the DLLs together with the executable. Just tell the installer to copy the DLLs into the application directory.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by ONEEYEMAN »

Hi,
Or copy it to someplace where the PATH points to.

Thank you.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by Mamo_Grag17 »

Thank you, i know that i can ship them with installer then put them in my app folder in programs folder, but i mean how does the application will know wich file to link with when it will start, not when installing.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by ONEEYEMAN »

Hi,
Not sure what you mean exactly.
It wil look for DLLs in you executable folder, then for DLL in your PATH.

If its not that - please clarify.

Thank you.
Mamo_Grag17
Earned some good credits
Earned some good credits
Posts: 107
Joined: Thu Mar 31, 2022 7:45 pm
Location: Morocco

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by Mamo_Grag17 »

Thank you i have understood this section, but how does my wx code look like, how am i going to include wxwidgets, like in simple application i include it by #include <wx/app.h>
But the wx folder isn't in my system how is it will work ?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: What is the best way to get wxwidgets for your app in a system that doesn't have it

Post by ONEEYEMAN »

Hi,
Do you want to let you end-user to compile your application?
Or you want to just distribute the binaries?

And what OS are you targeting?

Thank you.
Post Reply