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
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Wed May 22, 2019 2:54 pm

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.

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

Re: Ubuntu can't link wxStyledTextCtrl

Post by ONEEYEMAN » Wed May 22, 2019 3:29 pm

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: 3884
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Ubuntu can't link wxStyledTextCtrl

Post by DavidHart » Wed May 22, 2019 3:59 pm

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
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Wed May 22, 2019 5:26 pm

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.

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

Re: Ubuntu can't link wxStyledTextCtrl

Post by ONEEYEMAN » Wed May 22, 2019 6:59 pm

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

Thank you.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Thu May 23, 2019 5:12 am

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.

User avatar
doublemax
Moderator
Moderator
Posts: 14056
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Ubuntu can't link wxStyledTextCtrl

Post by doublemax » Thu May 23, 2019 6:07 am

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
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Thu May 23, 2019 6:25 am

I did add to the configure line --enable-stc
The wx build is running...
Best regards,
Rob.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Thu May 23, 2019 1:28 pm

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.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Thu May 23, 2019 1:40 pm

the --libs all does not show stc:

Code: Select all

[email protected]:~ $ /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.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Thu May 23, 2019 1:49 pm

It seems this configure parameter
--enable-mslu
does screw up things...
Best regards,
Rob.

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 307
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by New Pagodi » 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).

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Thu May 23, 2019 2:09 pm

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.

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

Re: Ubuntu can't link wxStyledTextCtrl

Post by ONEEYEMAN » Thu May 23, 2019 3:29 pm

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

Why do you need this one?

Thank you.

User avatar
rocrail
I live to help wx-kind
I live to help wx-kind
Posts: 179
Joined: Fri Oct 02, 2009 2:02 pm
Contact:

Re: Ubuntu can't link wxStyledTextCtrl

Post by rocrail » Fri May 24, 2019 9:19 am

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.

Post Reply