Ubuntu can't link wxStyledTextCtrl 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.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

Hi,

I want to use the wxStyledTextCtrl for viewing and modifying XML.
Compile and Link under macOS with wxWidgets 3.1.3 is OK and works perfectly.

But all Linux distributions compile, but do not link because the wxStyledTextCtrl is unresolved. (wxWidgets 3.0.4)

Any suggestions?
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Ubuntu can't link wxStyledTextCtrl

Post by ONEEYEMAN »

Hi,
stc is usually compiled as a different library and named appropriately (something like libwx*stc).
Try browsing the appropriate repository and install the appropriate binary.

Thank you.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Ubuntu can't link wxStyledTextCtrl

Post by DavidHart »

Hi,

How do you link? What is your wx-config linker line?

I ask because you're likely tripping over this change.

Regards,

David
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

Hi David,

I add the stc in the libs line:

Code: Select all

--libs core,base,aui,stc
Now it compiles under Linux, but under Windows this seems not to do the trick.

Code: Select all

a ../winbin/librocutils.a `/usr/x86_64-w64-mingw32/bin/wx-config --libs core,base,aui,stc` -static-libgcc -static  -liphlpapi -lmpr -lmswsock -lws2_32 -ladvapi32 
/usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a(monolib_stc.o):stc.cpp:(.text+0x17a1): Warnung: undefinierter Verweis auf »Scintilla_LinkLexers«
/usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a(monolib_PlatWX.o):PlatWX.cpp:(.text+0x1f4f): Warnung: undefinierter Verweis auf »UTF8Length(wchar_t const*, unsigned int)«
/usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a(monolib_PlatWX.o):PlatWX.cpp:(.text+0x1fa8): Warnung: undefinierter Verweis auf »UTF8FromUTF16(wchar_t const*, unsigned int, char*, unsigned int)«
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Ubuntu can't link wxStyledTextCtrl

Post by ONEEYEMAN »

Hi,
What did you use under Windows to compile the library? With what options?

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

Hi,

this is the configure line:

Code: Select all

../configure --prefix=/usr/x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-msw --enable-unicode --enable-mslu --disable-shared --enable-graphics_ctx --enable-monolithic
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Ubuntu can't link wxStyledTextCtrl

Post by doublemax »

Build the "stc" sample and check its linker command.

Under Windows, but using Visual Studio, i see two libraries related to stc:
wxmsw31ud_stc.lib and wxscintilla.lib

I would suspect you're missing the second one. (the names will be different when using mingw though).
Use the source, Luke!
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

I did add to the configure line --enable-stc
The wx build is running...
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

I have included stc in the --libs, but still no luck:

Code: Select all

... `/usr/x86_64-w64-mingw32/bin/wx-config --libs core,base,aui,stc` -static-libgcc -static  -liphlpapi -lmpr -lmswsock -lws2_32 -ladvapi32 

/usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a(monolib_stc.o):stc.cpp:(.text+0x1f81): undefined reference to `Scintilla_LinkLexers'
/usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a(monolib_PlatWX.o):PlatWX.cpp:(.text+0x201f): undefined reference to `UTF8Length(wchar_t const*, unsigned int)'
/usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a(monolib_PlatWX.o):PlatWX.cpp:(.text+0x2078): undefined reference to `UTF8FromUTF16(wchar_t const*, unsigned int, char*, unsigned int)'
The wx Build does list up stc:

Code: Select all

 Available libraries in this build are:
  xrc webview stc richtext ribbon propgrid aui gl html qa adv core xml net base
The generated wx libraries:
Screenshot 2019-05-23 at 15.27.24.png
Any help is very appreciated.
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

the --libs all does not show stc:

Code: Select all

pi@raspi9:~ $ /usr/x86_64-w64-mingw32/bin/wx-config --libs all
  -Wl,--subsystem,windows -mwindows /usr/x86_64-w64-mingw32/lib/libwx_mswu-3.0-x86_64-w64-mingw32.a -lwxregexu-3.0-x86_64-w64-mingw32 -lwxexpat-3.0-x86_64-w64-mingw32 -lwxtiff-3.0-x86_64-w64-mingw32 -lwxjpeg-3.0-x86_64-w64-mingw32 -lwxpng-3.0-x86_64-w64-mingw32 -lwxzlib-3.0-x86_64-w64-mingw32 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32 
Best regards,
Rob.
https://wiki.rocrail.net
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

It seems this configure parameter
--enable-mslu
does screw up things...
Best regards,
Rob.
https://wiki.rocrail.net
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 469
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by New Pagodi »

When linking statically, you also need to include the scintilla library (wxscintilla-3.0-x86_64-w64-mingw32.a based on the picture you posted above).
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

New Pagodi wrote: Thu May 23, 2019 2:05 pm When linking statically, you also need to include the scintilla library (wxscintilla-3.0-x86_64-w64-mingw32.a based on the picture you posted above).
Yes, that did work.
I will try the master branch...
Best regards,
Rob.
https://wiki.rocrail.net
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Ubuntu can't link wxStyledTextCtrl

Post by ONEEYEMAN »

Hi,
Also, --enable-monolithic might be the culprit...

Why do you need this one?

Thank you.
User avatar
rocrail
Super wx Problem Solver
Super wx Problem Solver
Posts: 299
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail »

I switch for win32/64 to the master branch 3.1.3.
Without changing anything in the build process the scintilla library is included automatically.
BTW: Both win32 and win64 are cross compiled on an RPi with Raspbian and mingw.
Best regards,
Rob.
https://wiki.rocrail.net
Post Reply