Build wxWidgets from sln file

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.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

ONEEYEMAN wrote: Thu Jan 26, 2023 1:25 pm Hi,
wxWidgets gives you Makefile in order to build the library.
Thank you.
I
But which exactly Makefile you tallking about? There are some files with the name Makefile, but none of them can be opened with CB.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Build wxWidgets from sln file

Post by ONEEYEMAN »

Hi,
Why do you want to OPEN it?

Check with C::B team on how to build wxWidgets from inside...

Thank you.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

ONEEYEMAN wrote: Fri Jan 27, 2023 6:08 pm Hi,
Why do you want to OPEN it?

Check with C::B team on how to build wxWidgets from inside...

Thank you.
Can you explain what exactly you mean by build wxWidgets from inside?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Build wxWidgets from sln file

Post by ONEEYEMAN »

Hi,
In MSVC you can add the dependency project in the solution you are trying to build.

Just add wxWidgets source and include folder inside the C::B project.

Or ask CB team how to build wxWidgets itself from inside the IDE.

Or even better - use CMake thingy.

Thank you.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

ONEEYEMAN wrote: Sun Jan 29, 2023 4:08 pm Hi,
In MSVC you can add the dependency project in the solution you are trying to build.

Just add wxWidgets source and include folder inside the C::B project.

Or ask CB team how to build wxWidgets itself from inside the IDE.

Or even better - use CMake thingy.

Thank you.
But how to use CMake? Have not found CMakelist.txt.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Build wxWidgets from sln file

Post by ONEEYEMAN »

Hi,
What version of wxWidgets do you have? On what platform? What version of CMake?
How did you search for the file?

Thank you.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

ONEEYEMAN wrote: Mon Jan 30, 2023 2:51 pm Hi,
What version of wxWidgets do you have? On what platform? What version of CMake?
How did you search for the file?

Thank you.
wxWidgets-3.0.5, platform is Windows, version of CMake 3.22.1 and I am searching in build\msw.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Build wxWidgets from sln file

Post by ONEEYEMAN »

Hi,
gtafan wrote: Mon Jan 30, 2023 5:11 pm
ONEEYEMAN wrote: Mon Jan 30, 2023 2:51 pm Hi,
What version of wxWidgets do you have? On what platform? What version of CMake?
How did you search for the file?

Thank you.
wxWidgets-3.0.5, platform is Windows, version of CMake 3.22.1 and I am searching in build\msw.
Why?
Did you try the c:\wxWidgets?

Thank you.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

ONEEYEMAN wrote: Mon Jan 30, 2023 6:21 pm
Why?
Did you try the c:\wxWidgets?

Thank you.
Yes I tried, but no CMakeLists.txt.
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Build wxWidgets from sln file

Post by doublemax@work »

wx 3.0.5 is pretty old, it didn't have official cmake support back then.

The current wx 3.2.1 does have a CMakeLists.txt
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

While this seems to be a problem of CB in first place, really don´t understand the reason for having diferent build setings for Visual Studio and GCC.

I was able to build all samples from wxWidgets in CB using the coresponding vcprj files and the samples work fine.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Build wxWidgets from sln file

Post by ONEEYEMAN »

Hi,
What do you mean "different build settings"?
Try to run "--configure--help" on Linux.

Thank you.
gtafan
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 201
Joined: Wed Mar 29, 2017 9:52 am

Re: Build wxWidgets from sln file

Post by gtafan »

ONEEYEMAN wrote: Sat Feb 04, 2023 5:14 pm Hi,
What do you mean "different build settings"?
Try to run "--configure--help" on Linux.

Thank you.
Was refering to Windows only, should be clear from the context of the question.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Build wxWidgets from sln file

Post by ONEEYEMAN »

Hi,
In this case, open include\wx\msw\setup.h and see all the defines available.
But besides that, you can use dynamic/static, debug/release and up until now UNICODE/ASCII builds.
So there are different settings available to build wxWidgets...
But in you so unique and so unsupported case only one build setting is.

Thank you.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Build wxWidgets from sln file

Post by PB »

Firstly, let me repeat my opinion: I think trying to build wxWidgets with Code::Blocks instead of any of the many supported, easy, and robust ways is counter-productive.

Be that as it may, I tried to build wxWidgets inside Code::Blocks using the simplest possible way: with CMake, using "CodeBlocks - MinGW Makefiles" generator.

1. I have installed CMake (v 3.24.1), C::B (v20.03) and MinGW (MSYS2 package mingw-w64-x86_64-toolchain) and wxWidgets 3.2.1 sources.
2. I went to the wxWidgets folder and ran

Code: Select all

PATH=C:\msys64\mingw64\bin;C:\Program Files\CMake\bin\;%PATH%
cmake-gui -S . -B ..\wxWidgets-3.2.1-build-CB-msysgcc_x64_DLL-debug
where "..\wxWidgets-3.2.1-build-CB-msysgcc_x64_DLL-debug" is the out-of-source folder where wxWidgets will be built.
3. I pressed "Configure", selected "CodeBlocks - MinGW Makefiles" generator, the only thing I have changed in the build settings CMakeGUI was setting wxBUILD_SAMPLES to "SOME" and pressed Generate.
wxwidgets-cmakegui-cb.png
wxwidgets-cmakegui-cb.png (72.37 KiB) Viewed 1410 times
4. I have opened the generated project "wxWidgets.cbp", made sure it used my compiler configuration (I don't use the default GNU GCC Compiler) and pressed Build. After about twenty minutes, wxWidgets project (including a few samples) was successfully built.
wxwidgets-built-cb.png
wxwidgets-built-cb-dir.png
wxwidgets-built-cb-dir.png (49.56 KiB) Viewed 1406 times
Once again, this is very impractical, among else "CodeBlocks - MinGW Makefiles" generator not supporting multiple targets at once (e.g., Debug and Release) and building by default with just one CPU core. Either way, the goal, i.e., "build wxWidgets with Code::Blocks" was achieved even if it was just a pointless exercise. For real use, I should have let CMake also install the wxWidgets and made sure that headers and both Debug and Release libraries are where expected.

Once again, I strongly advise against attempting to build wxWidgets inside C::B.
Post Reply