How to install the latest wxWidgets on Ubuntu

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.
LsDevs
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Feb 28, 2020 8:23 am

Re: How to install the latest wxWidgets on Ubuntu

Post by LsDevs » Sun Mar 01, 2020 10:54 pm

kagi3624 wrote:
Sun Mar 01, 2020 8:00 pm
hello LsDvs, I figured out how to crosscompile, but I have two questions, what does --disable-debug_flag do, is it necessary? And even though I disabled shared libraries I still got missing dll errors (libstdc++-6.dll and libgcc_s_seh-1.dll ) while launching the .exe in windows.

Sorry for asking same question in some other thread.
I’m not really friendly with compilation flags so if you really want to know you can refer to the docs part about building the library.

In your case have you linked staticly libgcc and libstdc++ by adding -static-libgcc -static-libstdc++ ?
When you want to cross-compile something for Windows plateform you should link staticly libgcc and libstdc++ or add them into your app folder.

kagi3624
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Feb 26, 2020 8:13 am

Re: How to install the latest wxWidgets on Ubuntu

Post by kagi3624 » Mon Mar 02, 2020 9:06 am

since my ../configure had -disable-shared shouldn't they have been automatically added to the exe? Anyway, I used the make command in the minimal sample to compile.

LsDevs
Knows some wx things
Knows some wx things
Posts: 31
Joined: Fri Feb 28, 2020 8:23 am

Re: How to install the latest wxWidgets on Ubuntu

Post by LsDevs » Mon Mar 02, 2020 10:23 am

kagi3624 wrote:
Mon Mar 02, 2020 9:06 am
since my ../configure had -disable-shared shouldn't they have been automatically added to the exe? Anyway, I used the make command in the minimal sample to compile.
I don't think so.
If you want to cross-compile for windows, as I said, you need to add -static-libgcc and -static-libstdc++ this is not linked automatically.

Example :

Code: Select all

x86_64-w64-mingw32-g++ your/cpp/files.cpp  $(wx-config --cxxflags --libs) -static-libgcc -static-libstdc++

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4170
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to install the latest wxWidgets on Ubuntu

Post by ONEEYEMAN » Mon Mar 02, 2020 3:56 pm

Hi,
"--disable-shared" option specified that you want wxWidgets libraries to be linked statically.
However, the linker doesn't know anything about standard./default Windows libraries. Hence the additional option.

Thank you.

kagi3624
Earned a small fee
Earned a small fee
Posts: 14
Joined: Wed Feb 26, 2020 8:13 am

Re: How to install the latest wxWidgets on Ubuntu

Post by kagi3624 » Mon Mar 09, 2020 7:33 pm

Hello, thank you for the answers! I was able to crosscompile in Linux and the program was running in windows. However I can't compile with

Code: Select all

g++ -g hellow.cpp $(wx-config --cxxflags --libs all) -o baz
It says.

Code: Select all

g++: error: unrecognized command line option ‘-mwindows’; did you mean ‘-m3dnow’?
I have both builds (gtk and ming) and the examples from both compile with the make file.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4170
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to install the latest wxWidgets on Ubuntu

Post by ONEEYEMAN » Mon Mar 09, 2020 8:02 pm

Hi,
So what commands are being used to compile the samples?
If you can compare its output with what you are trying to use - it should give you the answer you are looking for.

Thank you.

Post Reply