Author Topic: Compiling SpellChecker on linux  (Read 2039 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Compiling SpellChecker on linux
« on: February 18, 2019, 09:59:46 am »
Hi,
if i try to compile the SpellChecker plugin on linux i get linker errors:
Code: [Select]
g++ -shared -L../../../devel30 ../../../.objs30/plugins/contrib/SpellChecker/DictionariesNeededDialog.o ../../../.objs30/plugins/contrib/SpellChecker/MySpellingDialog.o ../../../.objs30/plugins/contrib/SpellChecker/mythes.o ../../../.objs30/plugins/contrib/SpellChecker/OnlineSpellChecker.o ../../../.objs30/plugins/contrib/SpellChecker/SpellCheckerConfig.o ../../../.objs30/plugins/contrib/SpellChecker/SpellCheckerPlugin.o ../../../.objs30/plugins/contrib/SpellChecker/SpellCheckHelper.o ../../../.objs30/plugins/contrib/SpellChecker/SpellCheckSettingsPanel.o ../../../.objs30/plugins/contrib/SpellChecker/StatusField.o ../../../.objs30/plugins/contrib/SpellChecker/Thesaurus.o ../../../.objs30/plugins/contrib/SpellChecker/ThesaurusDialog.o ../../../.objs30/plugins/contrib/SpellChecker/wxThes.o  -o ../../../devel30/share/codeblocks/plugins/libSpellChecker.so -Wl,--no-undefined -L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  -lhunspell-1.6  -lwxSpellChecker -lcodeblocks
../../../devel30/libwxSpellChecker.a(HunspellInterface.o): In function `void wxDELETE<Hunspell>(Hunspell*&)':
/usr/include/wx-3.0/wx/defs.h:744: undefined reference to `Hunspell::~Hunspell()'
../../../devel30/libwxSpellChecker.a(HunspellInterface.o): In function `HunspellInterface::IsWordInDictionary(wxString const&)':
/home/user/codeblocks/svn/src/plugins/contrib/SpellChecker/HunspellInterface.cpp:221: undefined reference to `Hunspell::spell(char const*, int*, char**)'
../../../devel30/libwxSpellChecker.a(HunspellInterface.o): In function `HunspellInterface::GetSuggestions(wxString const&)':
/home/user/codeblocks/svn/src/plugins/contrib/SpellChecker/HunspellInterface.cpp:199: undefined reference to `Hunspell::suggest(char***, char const*)'
../../../devel30/libwxSpellChecker.a(HunspellInterface.o): In function `HunspellInterface::GetCharacterEncoding()':
/home/user/codeblocks/svn/src/plugins/contrib/SpellChecker/HunspellInterface.cpp:433: undefined reference to `Hunspell::get_dic_encoding()'
../../../devel30/libwxSpellChecker.a(HunspellInterface.o): In function `HunspellInterface::InitializeSpellCheckEngine()':
/home/user/codeblocks/svn/src/plugins/contrib/SpellChecker/HunspellInterface.cpp:69: undefined reference to `Hunspell::Hunspell(char const*, char const*, char const*)'

I have to modify the linker commands to this to be able to compile
Code: [Select]
`$(WX_CONFIG) --libs`
-lwxSpellChecker
`pkg-config hunspell --libs`

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11931
    • Travis build status
Re: Compiling SpellChecker on linux
« Reply #1 on: February 18, 2019, 08:02:13 pm »
What is the difference in command lines between the two?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #2 on: February 18, 2019, 09:17:11 pm »
Hundspell  and wxSpellChecker change place...
Not working:
Code: [Select]
-lhunspell-1.6  -lwxSpellCheckerWorking
Code: [Select]
-lwxSpellChecker -lhunspell-1.6So the order matters for gcc (as we all know...)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11931
    • Travis build status
Re: Compiling SpellChecker on linux
« Reply #3 on: February 18, 2019, 10:13:19 pm »
It matter for the linker and not GCC! I guess it is safe to commit it. But for me it works fine. No idea why for you it doesn't work.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #4 on: February 19, 2019, 10:30:10 am »
Code: [Select]
But for me it works fine. No idea why for you it doesn't work.I would like to investigate about this, before i fix a problem that is not there...
As far as i understand the resolving of the symbols by the linker is revers, so if library A needs symbols from library B the library order for the linker has to be
Code: [Select]
-lA -lB
And this is the case here: wxSpellChecker needs symbols from hunspell-1.6. Why did it ever worked? Or why did it stopped for me to work? Does someone else also has this problem?.. Does this has something to do with the evaluation order? First the "other linker commands" and then the linker libraries? I use the latest trunk version of codeblocks...


Code: [Select]
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11931
    • Travis build status
Re: Compiling SpellChecker on linux
« Reply #5 on: February 19, 2019, 07:29:24 pm »
I'm running Gentoo and GCC 6.x. Does it build if you use autotools?
What you're saying about the order is correct.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Compiling SpellChecker on linux
« Reply #6 on: February 19, 2019, 07:40:59 pm »
Quote
Configured with: ../src/configure
It seems like he does.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #7 on: February 19, 2019, 08:04:49 pm »
I can build it with autotools without problems...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11931
    • Travis build status
Re: Compiling SpellChecker on linux
« Reply #8 on: February 19, 2019, 08:46:23 pm »
Quote
Configured with: ../src/configure
It seems like he does.
Nope. This is from the gcc -v execution. GCC records the configure command, so when reporting bugs it will save some questions and back and forths.

@bluehazzard: Is the linking order different during linking with libtool?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline blauzahn

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Compiling SpellChecker on linux
« Reply #9 on: February 19, 2019, 09:01:36 pm »
Quote
Nope. This is from the gcc -v execution
Sorry. Too tired to spot that immediately.

On my Ubuntu 18.04 I and can compile and link cb including SpellChecker plugin
via autotools

svn 11575, wx3.1.3,  gcc_7.3.0_Linux/unicode - 64 bit

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #10 on: February 20, 2019, 11:58:53 am »
As far as i can tell there libhunspell is also added after the wxSpellChecker library:
Code: [Select]
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o  .libs/DictionariesNeededDialog.o .libs/MySpellingDialog.o .libs/OnlineSpellChecker.o .libs/SpellCheckHelper.o .libs/SpellCheckSettingsPanel.o .libs/SpellCheckerConfig.o .libs/SpellCheckerPlugin.o .libs/StatusField.o .libs/Thesaurus.o .libs/ThesaurusDialog.o .libs/mythes.o .libs/wxThes.o  -Wl,--whole-archive wxspellchecker/.libs/libwxSpellChecker.a -Wl,--no-whole-archive  -Wl,-rpath -Wl,/home/user/codeblocks/git/codeblocks_sf/src/sdk/.libs -Wl,-rpath -Wl,/home/user/codeblocks/install2/lib ../../../sdk/.libs/libcodeblocks.so -L/usr/lib/x86_64-linux-gnu -lwx_gtk2u_aui-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_richtext-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0 -lhunspell-1.6 -ltinyxml -lpthread -ldl -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtfastmath.o /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o  -O2 -Wl,--no-undefined -pthread   -pthread -Wl,-soname -Wl,libSpellChecker.so -o .libs/libSpellChecker.so
removed the unused things:
Code: [Select]
libtool: link: g++  -fPIC -DPIC -shared -nostdlib [...objectFiles...] -Wl,--whole-archive wxspellchecker/.libs/libwxSpellChecker.a -Wl,--no-whole-archive [...wxLibs...] -lhunspell-1.6 [...systemLibs...] [...libSearchPaths...] [...otherThings...]  -Wl,-soname -Wl,libSpellChecker.so -o .libs/libSpellChecker.soso the question remains, why does it work on your side... Can you post the linker command line for libSpellChecker.so ?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #11 on: May 12, 2019, 09:23:26 pm »
Ping.

Can some other on linux check if he has the same problem with compiling spell checker with codeblocks?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #12 on: July 25, 2019, 10:30:33 pm »
Can someone test this patch?
for me this fixes the building of codeblocks projects on linux

the additional changes are made by codeblocks automatically...

Code: [Select]
diff --git a/src/plugins/contrib/SpellChecker/SpellChecker_wx30-unix.cbp b/src/plugins/contrib/SpellChecker/SpellChecker_wx30-unix.cbp
index 90671136d..8a2037d90 100644
--- a/src/plugins/contrib/SpellChecker/SpellChecker_wx30-unix.cbp
+++ b/src/plugins/contrib/SpellChecker/SpellChecker_wx30-unix.cbp
@@ -49,12 +49,12 @@
  <Option run_host_application_in_terminal="0" />
  <Option projectCompilerOptionsRelation="2" />
  <Compiler>
+ <Add option="-fPIC" />
  <Add option="$(#CB_RELEASE_TYPE)" />
  <Add option="`$(WX_CONFIG) --cflags`" />
  <Add option="-fmessage-length=0" />
  <Add option="-fexceptions" />
  <Add option="-Winvalid-pch" />
- <Add option="-fPIC" />
  <Add option="-DCB_PRECOMP" />
  <Add option="-DcbDEBUG" />
  <Add directory="wxspellchecker/include" />
@@ -64,8 +64,8 @@
  </Compiler>
  <Linker>
  <Add option="`$(WX_CONFIG) --libs`" />
+ <Add option="-lwxSpellChecker" />
  <Add option="`pkg-config hunspell --libs`" />
- <Add library="wxSpellChecker" />
  <Add library="codeblocks" />
  <Add directory="../../../devel30" />
  </Linker>
diff --git a/src/plugins/contrib/source_exporter/Exporter_wx30-unix.cbp b/src/plugins/contrib/source_exporter/Exporter_wx30-unix.cbp
index d2c5e4a45..d6e32b05c 100644
--- a/src/plugins/contrib/source_exporter/Exporter_wx30-unix.cbp
+++ b/src/plugins/contrib/source_exporter/Exporter_wx30-unix.cbp
@@ -18,6 +18,11 @@
  <Compiler>
  <Add option="-DWXMAKINGLIB_PDFDOC" />
  </Compiler>
+ <Linker>
+ <Add option="`$(WX_CONFIG) --libs`" />
+ <Add option="`pkg-config --libs fontconfig`" />
+ <Add option="-Wl,--no-undefined" />
+ </Linker>
  </Target>
  <Target title="default">
  <Option output="../../../devel30/share/codeblocks/plugins/exporter" prefix_auto="1" extension_auto="1" />
@@ -30,7 +35,10 @@
  <Option run_host_application_in_terminal="0" />
  <Option projectLinkerOptionsRelation="2" />
  <Linker>
- <Add library="libwxPdfDocument.a" />
+ <Add option="-lwxPdfDocument" />
+ <Add option="`$(WX_CONFIG) --libs  base,core,xml`" />
+ <Add option="`pkg-config --libs fontconfig`" />
+ <Add option="-Wl,--no-undefined" />
  </Linker>
  <ExtraCommands>
  <Add after="zip -j9 ../../../devel30/share/codeblocks/exporter.zip manifest.xml" />
@@ -47,16 +55,16 @@
  <Compiler>
  <Add option="-Wextra" />
  <Add option="-Wall" />
+ <Add option="-std=c++11" />
+ <Add option="-fPIC" />
  <Add option="$(#CB_RELEASE_TYPE)" />
  <Add option="`$(WX_CONFIG) --cflags`" />
  <Add option="`pkg-config --cflags fontconfig`" />
  <Add option="-Winvalid-pch" />
  <Add option="-fexceptions" />
- <Add option="-fPIC" />
  <Add option="-DCB_PRECOMP" />
  <Add option="-DcbDEBUG" />
  <Add option="-DwxPDF_USE_WXMODULE=0" />
- <Add option="-std=c++11" />
  <Add directory="../../../include" />
  <Add directory="../../../include/tinyxml" />
  <Add directory="../../../sdk/wxscintilla/include" />
@@ -66,9 +74,6 @@
  <Add directory="wxPdfDocument/include" />
  </ResourceCompiler>
  <Linker>
- <Add option="`$(WX_CONFIG) --libs`" />
- <Add option="`pkg-config --libs fontconfig`" />
- <Add option="-Wl,--no-undefined" />
  <Add library="codeblocks" />
  <Add directory="../../../devel30" />
  </Linker>

[EDIT:] So there are two project files that need a fix the spell checker and the exporter.
« Last Edit: July 25, 2019, 10:34:00 pm by BlueHazzard »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #13 on: August 20, 2019, 09:42:32 pm »
@Obfuscated: can you test the patch on your system and tell me if it compiles? So i can close this...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11931
    • Travis build status
Re: Compiling SpellChecker on linux
« Reply #14 on: August 25, 2019, 05:16:16 pm »
I'm on windows for now...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #15 on: August 29, 2019, 11:50:13 pm »
I do not know why, but now i can not even compile the main project because of link library order:
Code: [Select]
g++ -shared -Ldevel30 .objs30/sdk/configmanager-revision.o .objs30/sdk/annoyingdialog.o .objs30/sdk/autodetectcompilers.o .objs30/sdk/base64.o .objs30/sdk/blockallocated.o .objs30/sdk/cbart_provider.o .objs30/sdk/cbauibook.o .objs30/sdk/cbcolourmanager.o .objs30/sdk/cbdebugger_interfaces.o .objs30/sdk/cbeditor.o .objs30/sdk/cbeditorprintout.o .objs30/sdk/cbexception.o .objs30/sdk/cbplugin.o .objs30/sdk/cbproject.o .objs30/sdk/cbstatusbar.o .objs30/sdk/cbstyledtextctrl.o .objs30/sdk/cbthreadpool.o .objs30/sdk/cbtreectrl.o .objs30/sdk/cbworkspace.o .objs30/sdk/ccmanager.o .objs30/sdk/compileoptionsbase.o .objs30/sdk/compiler.o .objs30/sdk/compilercommandgenerator.o .objs30/sdk/compilerfactory.o .objs30/sdk/compileroptions.o .objs30/sdk/compiletargetbase.o .objs30/sdk/configmanager.o .objs30/sdk/configurationpanel.o .objs30/sdk/configuretoolsdlg.o .objs30/sdk/confirmreplacedlg.o .objs30/sdk/crc32.o .objs30/sdk/debuggermanager.o .objs30/sdk/editarrayfiledlg.o .objs30/sdk/editarrayorderdlg.o .objs30/sdk/editarraystringdlg.o .objs30/sdk/editor_hooks.o .objs30/sdk/editorbase.o .objs30/sdk/editorcolourset.o .objs30/sdk/editorlexerloader.o .objs30/sdk/editormanager.o .objs30/sdk/editpairdlg.o .objs30/sdk/editpathdlg.o .objs30/sdk/edittooldlg.o .objs30/sdk/encodingdetector.o .objs30/sdk/externaldepsdlg.o .objs30/sdk/filefilters.o .objs30/sdk/filegroupsandmasks.o .objs30/sdk/filemanager.o .objs30/sdk/findreplacedlg.o .objs30/sdk/genericmultilinenotesdlg.o .objs30/sdk/globals.o .objs30/sdk/importers_globals.o .objs30/sdk/incremental_select_helper.o .objs30/sdk/infowindow.o .objs30/sdk/loggers.o .objs30/sdk/logmanager.o .objs30/sdk/macrosmanager.o .objs30/sdk/manager.o .objs30/sdk/menuitemsmanager.o .objs30/sdk/mozilla_chardet/src/CharDistribution.o .objs30/sdk/mozilla_chardet/src/JpCntx.o .objs30/sdk/mozilla_chardet/src/LangBulgarianModel.o .objs30/sdk/mozilla_chardet/src/LangCyrillicModel.o .objs30/sdk/mozilla_chardet/src/LangGreekModel.o .objs30/sdk/mozilla_chardet/src/LangHebrewModel.o .objs30/sdk/mozilla_chardet/src/LangHungarianModel.o .objs30/sdk/mozilla_chardet/src/LangThaiModel.o .objs30/sdk/mozilla_chardet/src/nsBig5Prober.o .objs30/sdk/mozilla_chardet/src/nsCharSetProber.o .objs30/sdk/mozilla_chardet/src/nsEscCharsetProber.o .objs30/sdk/mozilla_chardet/src/nsEscSM.o .objs30/sdk/mozilla_chardet/src/nsEUCJPProber.o .objs30/sdk/mozilla_chardet/src/nsEUCKRProber.o .objs30/sdk/mozilla_chardet/src/nsEUCTWProber.o .objs30/sdk/mozilla_chardet/src/nsGB2312Prober.o .objs30/sdk/mozilla_chardet/src/nsHebrewProber.o .objs30/sdk/mozilla_chardet/src/nsLatin1Prober.o .objs30/sdk/mozilla_chardet/src/nsMBCSGroupProber.o .objs30/sdk/mozilla_chardet/src/nsMBCSSM.o .objs30/sdk/mozilla_chardet/src/nsSBCharSetProber.o .objs30/sdk/mozilla_chardet/src/nsSBCSGroupProber.o .objs30/sdk/mozilla_chardet/src/nsSJISProber.o .objs30/sdk/mozilla_chardet/src/nsUniversalDetector.o .objs30/sdk/mozilla_chardet/src/nsUTF8Prober.o .objs30/sdk/multiselectdlg.o .objs30/sdk/newfromtemplatedlg.o .objs30/sdk/personalitymanager.o .objs30/sdk/pipedprocess.o .objs30/sdk/pluginmanager.o .objs30/sdk/pluginsconfigurationdlg.o .objs30/sdk/printing_types.o .objs30/sdk/projectbuildtarget.o .objs30/sdk/projectfile.o .objs30/sdk/projectfileoptionsdlg.o .objs30/sdk/projectlayoutloader.o .objs30/sdk/projectloader.o .objs30/sdk/projectloader_hooks.o .objs30/sdk/projectmanager.o .objs30/sdk/projectsfilemasksdlg.o .objs30/sdk/projecttemplateloader.o .objs30/sdk/scripting/bindings/sc_consts.o .objs30/sdk/scripting/bindings/sc_dialog.o .objs30/sdk/scripting/bindings/sc_globals.o .objs30/sdk/scripting/bindings/sc_io.o .objs30/sdk/scripting/bindings/sc_plugin.o .objs30/sdk/scripting/bindings/sc_progress.o .objs30/sdk/scripting/bindings/sc_util_dialogs.o .objs30/sdk/scripting/bindings/sc_wxtypes.o .objs30/sdk/scripting/bindings/scriptbindings.o .objs30/sdk/scriptingmanager.o .objs30/sdk/scriptsecuritywarningdlg.o .objs30/sdk/scrollingdialog.o .objs30/sdk/sdk_events.o .objs30/sdk/searchresultslog.o .objs30/sdk/selecttargetdlg.o .objs30/sdk/templatemanager.o .objs30/sdk/tinywxuni.o .objs30/sdk/toolsmanager.o .objs30/sdk/uservarmanager.o .objs30/sdk/workspaceloader.o .objs30/sdk/xtra_res.o  -o devel30/libcodeblocks.so -L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk2u_aui-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  -Wl,--no-undefined -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0  -ltxml -lsqplus -lsqstdlib -lsquirrel -lwxscintilla_cb
devel30/libwxscintilla_cb.a(ScintillaWX.o): In function `ScintillaWX::DoKeyDown(wxKeyEvent const&, bool*)':
/home/codeblocks/codeblocks/src/sdk/wxscintilla/src/ScintillaWX.cpp:1212: undefined reference to `gdk_display_get_default'
/home/codeblocks/codeblocks/src/sdk/wxscintilla/src/ScintillaWX.cpp:1212: undefined reference to `gdk_keymap_get_for_display'
/home/codeblocks/codeblocks/src/sdk/wxscintilla/src/ScintillaWX.cpp:1215: undefined reference to `gdk_keymap_lookup_key'

obviously -lgdk-x11-2.0 should be after -lwxscintilla_cb

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Compiling SpellChecker on linux
« Reply #16 on: August 30, 2019, 06:55:05 am »
I do not know why, but now i can not even compile the main project because of link library order:
Code: [Select]
g++ -shared -Ldevel30 .objs30/sdk/configmanager-revision.o .objs30/sdk/annoyingdialog.o .objs30/sdk/autodetectcompilers.o .objs30/sdk/base64.o .objs30/sdk/blockallocated.o .objs30/sdk/cbart_provider.o .objs30/sdk/cbauibook.o .objs30/sdk/cbcolourmanager.o .objs30/sdk/cbdebugger_interfaces.o .objs30/sdk/cbeditor.o .objs30/sdk/cbeditorprintout.o .objs30/sdk/cbexception.o .objs30/sdk/cbplugin.o .objs30/sdk/cbproject.o .objs30/sdk/cbstatusbar.o .objs30/sdk/cbstyledtextctrl.o .objs30/sdk/cbthreadpool.o .objs30/sdk/cbtreectrl.o .objs30/sdk/cbworkspace.o .objs30/sdk/ccmanager.o .objs30/sdk/compileoptionsbase.o .objs30/sdk/compiler.o .objs30/sdk/compilercommandgenerator.o .objs30/sdk/compilerfactory.o .objs30/sdk/compileroptions.o .objs30/sdk/compiletargetbase.o .objs30/sdk/configmanager.o .objs30/sdk/configurationpanel.o .objs30/sdk/configuretoolsdlg.o .objs30/sdk/confirmreplacedlg.o .objs30/sdk/crc32.o .objs30/sdk/debuggermanager.o .objs30/sdk/editarrayfiledlg.o .objs30/sdk/editarrayorderdlg.o .objs30/sdk/editarraystringdlg.o .objs30/sdk/editor_hooks.o .objs30/sdk/editorbase.o .objs30/sdk/editorcolourset.o .objs30/sdk/editorlexerloader.o .objs30/sdk/editormanager.o .objs30/sdk/editpairdlg.o .objs30/sdk/editpathdlg.o .objs30/sdk/edittooldlg.o .objs30/sdk/encodingdetector.o .objs30/sdk/externaldepsdlg.o .objs30/sdk/filefilters.o .objs30/sdk/filegroupsandmasks.o .objs30/sdk/filemanager.o .objs30/sdk/findreplacedlg.o .objs30/sdk/genericmultilinenotesdlg.o .objs30/sdk/globals.o .objs30/sdk/importers_globals.o .objs30/sdk/incremental_select_helper.o .objs30/sdk/infowindow.o .objs30/sdk/loggers.o .objs30/sdk/logmanager.o .objs30/sdk/macrosmanager.o .objs30/sdk/manager.o .objs30/sdk/menuitemsmanager.o .objs30/sdk/mozilla_chardet/src/CharDistribution.o .objs30/sdk/mozilla_chardet/src/JpCntx.o .objs30/sdk/mozilla_chardet/src/LangBulgarianModel.o .objs30/sdk/mozilla_chardet/src/LangCyrillicModel.o .objs30/sdk/mozilla_chardet/src/LangGreekModel.o .objs30/sdk/mozilla_chardet/src/LangHebrewModel.o .objs30/sdk/mozilla_chardet/src/LangHungarianModel.o .objs30/sdk/mozilla_chardet/src/LangThaiModel.o .objs30/sdk/mozilla_chardet/src/nsBig5Prober.o .objs30/sdk/mozilla_chardet/src/nsCharSetProber.o .objs30/sdk/mozilla_chardet/src/nsEscCharsetProber.o .objs30/sdk/mozilla_chardet/src/nsEscSM.o .objs30/sdk/mozilla_chardet/src/nsEUCJPProber.o .objs30/sdk/mozilla_chardet/src/nsEUCKRProber.o .objs30/sdk/mozilla_chardet/src/nsEUCTWProber.o .objs30/sdk/mozilla_chardet/src/nsGB2312Prober.o .objs30/sdk/mozilla_chardet/src/nsHebrewProber.o .objs30/sdk/mozilla_chardet/src/nsLatin1Prober.o .objs30/sdk/mozilla_chardet/src/nsMBCSGroupProber.o .objs30/sdk/mozilla_chardet/src/nsMBCSSM.o .objs30/sdk/mozilla_chardet/src/nsSBCharSetProber.o .objs30/sdk/mozilla_chardet/src/nsSBCSGroupProber.o .objs30/sdk/mozilla_chardet/src/nsSJISProber.o .objs30/sdk/mozilla_chardet/src/nsUniversalDetector.o .objs30/sdk/mozilla_chardet/src/nsUTF8Prober.o .objs30/sdk/multiselectdlg.o .objs30/sdk/newfromtemplatedlg.o .objs30/sdk/personalitymanager.o .objs30/sdk/pipedprocess.o .objs30/sdk/pluginmanager.o .objs30/sdk/pluginsconfigurationdlg.o .objs30/sdk/printing_types.o .objs30/sdk/projectbuildtarget.o .objs30/sdk/projectfile.o .objs30/sdk/projectfileoptionsdlg.o .objs30/sdk/projectlayoutloader.o .objs30/sdk/projectloader.o .objs30/sdk/projectloader_hooks.o .objs30/sdk/projectmanager.o .objs30/sdk/projectsfilemasksdlg.o .objs30/sdk/projecttemplateloader.o .objs30/sdk/scripting/bindings/sc_consts.o .objs30/sdk/scripting/bindings/sc_dialog.o .objs30/sdk/scripting/bindings/sc_globals.o .objs30/sdk/scripting/bindings/sc_io.o .objs30/sdk/scripting/bindings/sc_plugin.o .objs30/sdk/scripting/bindings/sc_progress.o .objs30/sdk/scripting/bindings/sc_util_dialogs.o .objs30/sdk/scripting/bindings/sc_wxtypes.o .objs30/sdk/scripting/bindings/scriptbindings.o .objs30/sdk/scriptingmanager.o .objs30/sdk/scriptsecuritywarningdlg.o .objs30/sdk/scrollingdialog.o .objs30/sdk/sdk_events.o .objs30/sdk/searchresultslog.o .objs30/sdk/selecttargetdlg.o .objs30/sdk/templatemanager.o .objs30/sdk/tinywxuni.o .objs30/sdk/toolsmanager.o .objs30/sdk/uservarmanager.o .objs30/sdk/workspaceloader.o .objs30/sdk/xtra_res.o  -o devel30/libcodeblocks.so -L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk2u_aui-3.0 -lwx_gtk2u_propgrid-3.0 -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0  -Wl,--no-undefined -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0  -ltxml -lsqplus -lsqstdlib -lsquirrel -lwxscintilla_cb
devel30/libwxscintilla_cb.a(ScintillaWX.o): In function `ScintillaWX::DoKeyDown(wxKeyEvent const&, bool*)':
/home/codeblocks/codeblocks/src/sdk/wxscintilla/src/ScintillaWX.cpp:1212: undefined reference to `gdk_display_get_default'
/home/codeblocks/codeblocks/src/sdk/wxscintilla/src/ScintillaWX.cpp:1212: undefined reference to `gdk_keymap_get_for_display'
/home/codeblocks/codeblocks/src/sdk/wxscintilla/src/ScintillaWX.cpp:1215: undefined reference to `gdk_keymap_lookup_key'

obviously -lgdk-x11-2.0 should be after -lwxscintilla_cb

See
http://forums.codeblocks.org/index.php/topic,23316.msg159468.html#msg159468

Your link errors look exactly like the above topic, and the suggested solution worked for me.

What happens if you remove wxscintilla from the list of libraries and put -lwxscintilla_cb before the `pkg-config` line? My guess is that this would fix the build.
« Last Edit: August 30, 2019, 07:00:18 am by Pecan »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2454
Re: Compiling SpellChecker on linux
« Reply #17 on: August 30, 2019, 10:49:51 am »
So you probably hit also the spell checker errors? Why is mint and ubuntu so picky and centos seems to be not... I wanted to try arch, but had not the time to do it...
Anyway i think i will push the changes... After reading the gcc manual, i am pretty sure that the order of libraries is not conform to the gcc behavior and we should fix this..

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2165
Re: Compiling SpellChecker on linux
« Reply #18 on: August 31, 2019, 06:44:57 am »
So you probably hit also the spell checker errors? Why is mint and ubuntu so picky and centos seems to be not... I wanted to try arch, but had not the time to do it...
Anyway i think i will push the changes... After reading the gcc manual, i am pretty sure that the order of libraries is not conform to the gcc behavior and we should fix this..

For me, I don't believe this error has anything to do specifically with SpellChecker. I've never compiled, used or installed it.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11931
    • Travis build status
Re: Compiling SpellChecker on linux
« Reply #19 on: September 01, 2019, 12:11:24 am »
The linking problems should be fixed in svn...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]