Page 3 of 3

Re: Why there is no compiled WxWidgets version?

Posted: Mon Jul 27, 2020 11:05 am
by gtafan
PB wrote:
Thu Jul 23, 2020 2:17 pm
gtafan wrote:
Thu Jul 23, 2020 1:23 pm
That comandline is a bit longer, at least if you want to have it build the way you want.
What are you missing in the command line compared to the official build (static vs shared aside)? That is how I build wxWidgets for myself with MSVC (the only difference there is using nmake instead of mingw32-make). If you want another options, you cannot use prebuilt wxWidgets binaries anyway? Even if you wanted to use more options, you just copy and paste the options once, save the command as a batch and you are done for ever.
gtafan wrote:
Thu Jul 23, 2020 1:23 pm
Static libraries have 1 huge advantage, you have just 1 single executable files, which you can use on as much PCs with the coresponding OS as you want, and no need to provide all that crapy dlls.
Distributing DLLs in 21st century is no big deal, pretty much every popular programs does that, even in the portable version. Static linking, in particular the CRT, has also many disadvantages and is generally not recommended, feasible, or even with some libraries possible.

Just out of curiousity, which other C++ compiled libraries are you familiar with, providing prebuilt static binaries for a large range of compilers? To me it seems you are not very experienced in C++: compared to other large libraries, wxWidgets build extremely easily, painlessly (as they have no external dependencies, at least on MSW), and quick.
gtafan wrote:
Thu Jul 23, 2020 1:23 pm
So even if it´s just 10 minutes, let say just 1000 people use the API, makes 10000 minutes wasted.
Not sure what API are you talking about. You also seem to confuse CPU time with human time. You can let the build go in the background, you do not need to fearfully stare at the scary command line window all the time the build is going on. Additionally, compared to resources wasted in other ways, building wxWidgets
gtafan wrote:
Thu Jul 23, 2020 1:23 pm

Also system environment variable has nothing to do with C++, at least as long you are using no external APIs, so you could said wxWidgets is not for me.
Even a power user knows how to use system environment variables, it is a must for a real programmer. When building wxWidgets, one commonly uses at least PATH and WXWIN (strongly recommended by the wxWidgets Team). But hey, finally something we can agree on: wxWidgets and C++ seems to be not the best fit for you. ;)
The comandline that worcks is:

Code: Select all

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 UNICODE=1 SHARED=0 CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport"
As you can see it´s a bit more complicated, that your one, which I also have used at very begining, but it completly failed. I understand that it´s huge worck to make precompiled builds for every existing compiler, but at leas some kind of auto builder would be really helpfull. By autobuilder I mean a tool which builds automaticaly wxWidgets for you. Such tool need to be writen once and then you can compile all posible wxWidgets versions with all posible compilers.
I still disagree that C++ is not my thing, saing that wxWidgets and C++ is not my thing is also incorect, as the problem I have with wxWidgets exists for at least all external C++ APIs I know. Unfortunately every C++ application with GUI has to use external API(s) and wxWidgets is just the best from all known by me APIs.

Re: Why there is no compiled WxWidgets version?

Posted: Mon Jul 27, 2020 12:17 pm
by PB
I have very little knowledge of GCC but I have built many wxWidgets versions in different configurations using different flavors of MinGW, with GCC versions ranging from 5 to 10 so I do know a bit about wxWidgets build options. The command line I posted before certainly works.
gtafan wrote:
Mon Jul 27, 2020 11:05 am
The comandline that worcks is:

Code: Select all

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 UNICODE=1 SHARED=0 CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport"
That is not how the official release is built and most of your options are useless or even harmful. TBH, it seems as if you copied some outdated instructions, without really understanding what the individual build options actually mean.

MONOLITHIC=1 is rather useless, particularly in the static build. I see no advantage, except of having to tell the linker about fewer libraries but that is the job for the IDE or very easy to do it by hand. Depending on how many libraries one actually uses, using monolithic build may also make building the application even slower?

UNICODE=1 is default, so there is no reason to use it there; same with SHARED=0.

AFAICT, the CXXFLAGS you listed are also bad. The year is 2020: Why use such old GNU variant of C++ standard instead of the actual C++ standard - GCC v6.1-10.x default to better C++14. Newer version of GCC support C++17 and newer.

The "-fno-keep-inline-dllexport" option is also useless: it was for certain old GCC compilers and only when building SHARED version of wxWidgets, to prevent the compiler from running out of memory.

Re: Why there is no compiled WxWidgets version?

Posted: Mon Jul 27, 2020 12:48 pm
by gtafan
PB wrote:
Mon Jul 27, 2020 12:17 pm
I have very little knowledge of GCC but I have built many wxWidgets versions in different configurations using different flavors of MinGW, with GCC versions ranging from 5 to 10 so I do know a bit about wxWidgets build options. The command line I posted before certainly works.
gtafan wrote:
Mon Jul 27, 2020 11:05 am
The comandline that worcks is:

Code: Select all

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 UNICODE=1 SHARED=0 CXXFLAGS="-std=gnu++11 -fno-keep-inline-dllexport"
That is not how the official release is built and most of your options are useless or even harmful. TBH, it seems as if you copied some outdated instructions, without really understanding what the individual build options actually mean.

MONOLITHIC=1 is rather useless, particularly in the static build. I see no advantage, except of having to tell the linker about fewer libraries but that is the job for the IDE or very easy to do it by hand. Depending on how many libraries one actually uses, using monolithic build may also make building the application even slower?

UNICODE=1 is default, so there is no reason to use it there; same with SHARED=0.

AFAICT, the CXXFLAGS you listed are also bad. The year is 2020: Why use such old GNU variant of C++ standard instead of the actual C++ standard - GCC v6.1-10.x default to better C++14. Newer version of GCC support C++17 and newer.

The "-fno-keep-inline-dllexport" option is also useless: it was for certain old GCC compilers and only when building SHARED version of wxWidgets, to prevent the compiler from running out of memory.
As you posibly have noticed, strongly dislike doing things by hand, so if I can avoid it I beter use MONOLITHIC=1. Is SHARED=0 the default option? The reason I used -std=gnu++11 is because of old compiler version, so with newer compiler version would change it to -std=gnu++14 or even -std=gnu++17 if suported. So the comandline could be then like this:

Code: Select all

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 SHARED=0 CXXFLAGS="-std=gnu++17"
I know you said SHARED=0 is unnecesary, but want to be shure that after wasting more then half an hour I get a static build and no useles dlls.

Re: Why there is no compiled WxWidgets version?

Posted: Mon Jul 27, 2020 1:56 pm
by PB
gtafan wrote:
Mon Jul 27, 2020 12:48 pm
I know you said SHARED=0 is unnecesary, but want to be shure that after wasting more then half an hour I get a static build and no useles dlls.
Well, if I wanted to know what a build option means, I would check the official documentation instead of waiting half an hour for the build to finish and then possibly having to do it again. But that's just the boring normal way of doing things, which you seem to find off putting.

But whatever works for you, let's close this fruitless discussion.

BTW, there is no need to quote the whole post just above yours.

Re: Why there is no compiled WxWidgets version?

Posted: Mon Jul 27, 2020 2:56 pm
by gtafan
SHARED=0 was not the problem, just wanted to know if the comandline from my previous post could worck and produce exactly what I need.
Looks like I have to write that auto build tool, mentioned befor, on my own. Just 1 question, can I redirect output from external comandline, like the one produced when building wxWidgets, to my wxWidgets application the same way like I do redirekt from cout and cerr?

Re: Why there is no compiled WxWidgets version?

Posted: Mon Jul 27, 2020 3:26 pm
by ONEEYEMAN
Hi,
Keep in mind that MONOLITHIC build might be dangerous.
There are situations where the program will fail to link to the monolithic library.
Just search the forum/web.
Besides, you are not gaining anything by using it. You just wasting some space. 😀

Thank you.

Re: Why there is no compiled WxWidgets version?

Posted: Tue Jul 28, 2020 8:39 pm
by PB
I have no idea what build system are you talking about, gtafan. Normally one would use a batch file, such as ones here
https://github.com/PBfordev/wxpbguide/t ... bats/build

Nevertheless, here is a fast, correct command to build wxWidgets in the same configuration you had

Code: Select all

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 setup_h
mingw32-make -f makefile.gcc -j4 BUILD=release MONOLITHIC=1
it assumes you have at 4 CPU cores available for build (see the value in -j option), if you one has more or less, the adjustment is needed.

Re: Why there is no compiled WxWidgets version?

Posted: Tue Jul 28, 2020 8:56 pm
by ONEEYEMAN
Hi, ALL,
I really, really, really don't understand why people in the year of 2020 do you use MONOLITHIC build of anything? ;-)

Thank you.

;-)

Re: Why there is no compiled WxWidgets version?

Posted: Fri Jul 31, 2020 11:51 am
by gtafan
PB wrote:
Tue Jul 28, 2020 8:39 pm
I have no idea what build system are you talking about, gtafan. Normally one would use a batch file, such as ones here
https://github.com/PBfordev/wxpbguide/t ... bats/build

Nevertheless, here is a fast, correct command to build wxWidgets in the same configuration you had

Code: Select all

mingw32-make -f makefile.gcc BUILD=release MONOLITHIC=1 setup_h
mingw32-make -f makefile.gcc -j4 BUILD=release MONOLITHIC=1
it assumes you have at 4 CPU cores available for build (see the value in -j option), if you one has more or less, the adjustment is needed.
Build system? I was tallking about a tool, which automaticaly builds wxWidgets, when you start the tool it serches for the compiler and if there is more then 1 compiler asks to select one, then it automaticaly builds wxWidgets wit the configurations, that also can be selected.

Re: Why there is no compiled WxWidgets version?

Posted: Fri Jul 31, 2020 3:57 pm
by ONEEYEMAN
Hi,
Why do you need such a tool? You build wxWidgets only once and you you may use different options for the build like debug/release.
Thats all.

Thank you.