How to build only one part of wxWidgets ? 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
User avatar
saifcoder
Experienced Solver
Experienced Solver
Posts: 80
Joined: Thu Nov 16, 2017 9:32 pm

How to build only one part of wxWidgets ?

Post by saifcoder »

Hello,

How to build only one part of wxWidgets ?, for example build only STC (wxStyledTextCtrl).

Thanks,
Debian 9 - GCC 6 - wxWidgets 3.x U
Win 10 - GCC 8 - wxWidgets 3.x U
Mac OS X 10.x - Clang - wxWidgets 3.x U
i am in love with WX. Yes.
User avatar
saifcoder
Experienced Solver
Experienced Solver
Posts: 80
Joined: Thu Nov 16, 2017 9:32 pm

Re: How to build only one part of wxWidgets ?

Post by saifcoder »

I can remove stclib_PlatWX.o, stclib_ScintillaWX.o, and stclib_stc.o, then 'make' again, is this is the only way ?
Debian 9 - GCC 6 - wxWidgets 3.x U
Win 10 - GCC 8 - wxWidgets 3.x U
Mac OS X 10.x - Clang - wxWidgets 3.x U
i am in love with WX. Yes.
Manolo
Can't get richer than this
Can't get richer than this
Posts: 828
Joined: Mon Apr 30, 2012 11:07 pm

Re: How to build only one part of wxWidgets ?

Post by Manolo »

There are some parts you can not avoid, as those included in "Base" and "Core" libraries. See http://docs.wxwidgets.org/trunk/page_libs.html

But you can switch off many features. Be aware that some features need other features, so you can't dismiss all. Procced by test/error, until you get a "good" configuration.

In Linux you may pass --disable-XXX parameters to the "./config" command. Use "./configure --help" to see the available options. And read /docs/gtk/install.txt.

In Windows you can edit yourwxdir\include\wx\msw\setup.h file and set '0' to some USE_XXX flags. Read docs/msw/install.txt
Once you've done the changes rebuild the library. I advice to use MONOLITHIC=0 so as to get several small files instead of an only big one.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to build only one part of wxWidgets ?

Post by ONEEYEMAN »

Hi,
The question I would ask is - why do you need this?
As long as you don't work on the embedded platform you should build the whole library with the default settings, especially if you will do development. You will never know what class you will need now or in the future.
The current linkers are smart enough to grab only functions/classeds that are needed for the application/library, so its useless.

If you work under embedded platform where the memory/hard drive is limited (and only then) you should follow Manolo's advice.

Thank you.
User avatar
saifcoder
Experienced Solver
Experienced Solver
Posts: 80
Joined: Thu Nov 16, 2017 9:32 pm

Re: How to build only one part of wxWidgets ?

Post by saifcoder »

Thank you for your replays, i already build full wxWidgets, and i ask myself, how core developers add and test new code/features.. of course they don't build full wxWidgets every time !

For example, after i made a small change in "stc.cpp" (wxStyledTextCtrl), i remove already compiled objects stclib_PlatWX.o, stclib_ScintillaWX.o, and stclib_stc.o, and then run make again, this will build only wxStyledTextCtrl and provide "libwx_osx_cocoau_alif_stc-3.1.a"

But, is this the way ? or there a command arguments to tell "make" to build only "stc" folder ?

Thanks,
Debian 9 - GCC 6 - wxWidgets 3.x U
Win 10 - GCC 8 - wxWidgets 3.x U
Mac OS X 10.x - Clang - wxWidgets 3.x U
i am in love with WX. Yes.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to build only one part of wxWidgets ?

Post by ONEEYEMAN »

Hi,
The core team is currently using TravisCI for automatic build and test process of the new features.

You don't need to remove anything - just "make" will re-build only the stuff you changed.

P.S.: Seeing that you are asking such a basic question I think you need to have more experience with writing some serious C++ code. You should get yourself a job with writing some, get a good grip of what a language is, how it works, what is the process of building/managing the source code and then start working with wxWidgets library.

Thank you.
User avatar
saifcoder
Experienced Solver
Experienced Solver
Posts: 80
Joined: Thu Nov 16, 2017 9:32 pm

Re: How to build only one part of wxWidgets ?

Post by saifcoder »

Thank you Manolo for your answer and helpful informations,

Thank you Oneeyeman for your answer, and yes, I am a beginner in C++, but i finish the project by your help, and every time I ask here a question I learn something from your answers, this forum is not only the best forums for wxWidgets, but is the best community ever

Thanks You, =D>
Debian 9 - GCC 6 - wxWidgets 3.x U
Win 10 - GCC 8 - wxWidgets 3.x U
Mac OS X 10.x - Clang - wxWidgets 3.x U
i am in love with WX. Yes.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to build only one part of wxWidgets ?

Post by ONEEYEMAN »

Hi,
Yes, I understand that.
But C++ is very powerful language. It taqkes time and experience to fully grasp the concept of it.
The wxWidgets library is written in C++ a long time ago and internally it uses the paradigms that is old.

When you start writing the program using standard (or default) wxWidgets library you should use a modern C++ (14 or even 17 standard), which were not available at the time of the writing the library. If you are the beginner in the language it will be hard for you.

Maybe you can switch to wxPython/Phoenix? The language is very easy to grasp, there is no compilation and you can test you code right on the spot.

Thank you.
Post Reply