wxRichTextCtrl undefined reference
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
wxRichTextCtrl undefined reference
Being a bit of a newb to the Linux side of both Codelite (CL) (13.0.5) & wxWidgets (3.1.2 manually built from Github code without issues)), I have installed both of these on a Mint box ( Mint Cinnamon 19.2)
The project I want to port from Windows, where it all compiles and runs, uses a wxRichTextCtrl window and the Codelite linker complains about the undefined reference.
As it is, I have no real clue where or how I would fix this, being used to multi-lib static linking under Windows
I can find my wxWidgets libraries and am prepared to give dynamic liking a try as some other basic wxWidgets app seem to compile and run, mainly the CL demo app.
The project I want to port from Windows, where it all compiles and runs, uses a wxRichTextCtrl window and the Codelite linker complains about the undefined reference.
As it is, I have no real clue where or how I would fix this, being used to multi-lib static linking under Windows
I can find my wxWidgets libraries and am prepared to give dynamic liking a try as some other basic wxWidgets app seem to compile and run, mainly the CL demo app.
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: wxRichTextCtrl undefined reference
Hi,
What does your Project Settings: Linker > Linker Options field contain? For a dynamic-linking wx it should be something like:
$(shell wx-config --libs std,richtext)
Regards,
David
What was your configure line? In particular, a static or dynamic build?wxWidgets (3.1.2 manually built from Github code without issues)
(Nitpick: The Mint linker. CL creates a makefile that calls the compiler and linker, it doesn't actually build the program itself.)Codelite linker complains about the undefined reference
What does your Project Settings: Linker > Linker Options field contain? For a dynamic-linking wx it should be something like:
$(shell wx-config --libs std,richtext)
Regards,
David
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
Re: wxRichTextCtrl undefined reference
Thank you.
That last part about "$(shell wx-config --libs std,richtext)" did the trick.
As for the static vs dynamic linking, I will have to explore down the road because for now I have only compiled the dynamic libs of wxWidgets.
If you can point me in the right direction on what I need to know to get static linking set up, I'll be very grateful. I understand Linux apps are typically set to use dynamic linking but as I am just as unfamiliar with packaging the app and all its dependencies so that I can give the app to someone else without too much fuss, I prefer to look at a statically linked package.
That last part about "$(shell wx-config --libs std,richtext)" did the trick.
As for the static vs dynamic linking, I will have to explore down the road because for now I have only compiled the dynamic libs of wxWidgets.
If you can point me in the right direction on what I need to know to get static linking set up, I'll be very grateful. I understand Linux apps are typically set to use dynamic linking but as I am just as unfamiliar with packaging the app and all its dependencies so that I can give the app to someone else without too much fuss, I prefer to look at a statically linked package.
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: wxRichTextCtrl undefined reference
Just make a wx build doing, in the extracted wx source, something like:If you can point me in the right direction on what I need to know to get static linking set up
mkdir disable-shared && cd disable-shared
../configure --disable-shared <--enable-debug --with-gtk=$(number) --whatever>
make -j`nproc`
I almost always add --prefix=$(pwd) to the configure line for such builds. That means they don't need to be 'make installed', you can use them where they are; you'd point to that dir's wx-config in your makefile or CL Compile and Linker settings. So your new Linker settings would be similar to:
$(shell /full/path/to/disable-shared/wx-config --libs std,richtext)
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
Re: wxRichTextCtrl undefined reference
Thank you.
I'll give this a try, once I get the dynamic version working well enough;
still have some porting issues to resolve.
I'll give this a try, once I get the dynamic version working well enough;
still have some porting issues to resolve.
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2
-
- CodeLite Expert
- Posts: 167
- Joined: Wed Oct 22, 2008 6:50 am
- Contact:
Re: wxRichTextCtrl undefined reference
Now that I have the dynamically linked version working as well as I need for the time being, I have started to try and implement the statically linked version. For the record & in case I need to come back to this:
I have executed the commands:
mkdir disable-shared && cd disable-shared
../configure --disable-shared --enable-debug --with-gtk=2 --prefix=$(pwd)
make -j4
and as far as I can tell, that all worked
Next I have changed the c++ compiler options to: $(shell ~/wxWidgets-3.1.2/disable-shared/wx-config --cflags)
and the linker options:$(shell ~/wxWidgets-3.1.2/disable-shared/wx-config --libs )
with the Libraries:
libwx_baseu-3.1
libwx_baseu_net-3.1
libwx_baseu_xml-3.1
libwx_gtk2u_adv-3.1
libwx_gtk2u_aui-3.1
libwx_gtk2u_core-3.1
libwx_gtk2u_gl-3.1
libwx_gtk2u_html-3.1
libwx_gtk2u_propgrid-3.1
libwx_gtk2u_qa-3.1
libwx_gtk2u_ribbon-3.1
libwx_gtk2u_richtext-3.1
libwx_gtk2u_stc-3.1
libwx_gtk2u_xrc-3.1
libwxjpeg-3.1
libwxregexu-3.1
libwxscintilla-3.1.a
curl.a
All compiles, links and executes and runs as well as the dynamically linked version
Big thank you to DavidGH
I have executed the commands:
mkdir disable-shared && cd disable-shared
../configure --disable-shared --enable-debug --with-gtk=2 --prefix=$(pwd)
make -j4
and as far as I can tell, that all worked
Next I have changed the c++ compiler options to: $(shell ~/wxWidgets-3.1.2/disable-shared/wx-config --cflags)
and the linker options:$(shell ~/wxWidgets-3.1.2/disable-shared/wx-config --libs )
with the Libraries:
libwx_baseu-3.1
libwx_baseu_net-3.1
libwx_baseu_xml-3.1
libwx_gtk2u_adv-3.1
libwx_gtk2u_aui-3.1
libwx_gtk2u_core-3.1
libwx_gtk2u_gl-3.1
libwx_gtk2u_html-3.1
libwx_gtk2u_propgrid-3.1
libwx_gtk2u_qa-3.1
libwx_gtk2u_ribbon-3.1
libwx_gtk2u_richtext-3.1
libwx_gtk2u_stc-3.1
libwx_gtk2u_xrc-3.1
libwxjpeg-3.1
libwxregexu-3.1
libwxscintilla-3.1.a
curl.a
All compiles, links and executes and runs as well as the dynamically linked version
Big thank you to DavidGH
Win 10/11 64-bit, MSVC 2019/2022, wxWidgets 3.2.1, CodeLite 17.0 Mint 21.2