Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Compiling SpellChecker on linux
BlueHazzard:
As far as i can tell there libhunspell is also added after the wxSpellChecker library:
--- Code: ---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
--- End code ---
removed the unused things:
--- Code: ---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.so
--- End code ---
so the question remains, why does it work on your side... Can you post the linker command line for libSpellChecker.so ?
BlueHazzard:
Ping.
Can some other on linux check if he has the same problem with compiling spell checker with codeblocks?
BlueHazzard:
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: --- 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>
--- End code ---
[EDIT:] So there are two project files that need a fix the spell checker and the exporter.
BlueHazzard:
@Obfuscated: can you test the patch on your system and tell me if it compiles? So i can close this...
oBFusCATed:
I'm on windows for now...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version