Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Compiling SpellChecker on linux

(1/4) > >>

BlueHazzard:
Hi,
if i try to compile the SpellChecker plugin on linux i get linker errors:

--- Code: ---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*)'
--- End code ---

I have to modify the linker commands to this to be able to compile

--- Code: ---`$(WX_CONFIG) --libs`
-lwxSpellChecker
`pkg-config hunspell --libs`

--- End code ---

oBFusCATed:
What is the difference in command lines between the two?

BlueHazzard:
Hundspell  and wxSpellChecker change place...
Not working:

--- Code: ----lhunspell-1.6  -lwxSpellChecker
--- End code ---
Working

--- Code: ----lwxSpellChecker -lhunspell-1.6
--- End code ---
So the order matters for gcc (as we all know...)

oBFusCATed:
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.

BlueHazzard:

--- Code: ---But for me it works fine. No idea why for you it doesn't work.
--- End code ---
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: ----lA -lB

--- End code ---
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: ---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)
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version