Cannot compile on *buntu #117

Closed
Slesa opened this Issue Jan 17, 2014 · 10 comments

Comments

Projects
None yet
2 participants
Contributor

Slesa commented Jan 17, 2014

One problem seems to be the line

unix {
  PKGCONFIG += hunspell
}

but after commenting it out, I get

hunspell/spellchecker.cpp:27:33: fatal error: hunspell/hunspell.hxx: No such file or directory
 #include <hunspell/hunspell.hxx>

so I add the line

unix:INCLUDEPATH += $$PWD/../3rdparty/hunspell/src

and finally I'll end up with

/usr/bin/ld: cannot find -lmarkdown
/usr/bin/ld: cannot find -lhoedown

Ok, hoedown was not build, so I change the directory to it and call 'build' - only markdown left. I could install it, but I don't like to.
It should be possible to add the library path pointing to the 3rdpart directory of discount...

(When installing discount of the Ubuntu system, I get a lot of unresolved externals of hunspell)

spellchecker.o: In function `hunspell::SpellChecker::~SpellChecker()':
spellchecker.cpp:(.text+0x35): undefined reference to `Hunspell::~Hunspell()'
spellchecker.o: In function `hunspell::SpellChecker::isCorrect(QString const&)':
spellchecker.cpp:(.text+0xdc): undefined reference to `Hunspell::spell(char const*, int*, char**)'
spellchecker.o: In function `hunspell::SpellChecker::suggestions(QString const&)':
spellchecker.cpp:(.text+0x1af): undefined reference to `Hunspell::suggest(char***, char const*)'
spellchecker.cpp:(.text+0x23c): undefined reference to `Hunspell::free_list(char***, int)'
spellchecker.o: In function `hunspell::SpellChecker::addToUserWordlist(QString const&)':
spellchecker.cpp:(.text+0xda1): undefined reference to `Hunspell::add(char const*)'
spellchecker.o: In function `hunspell::SpellChecker::loadUserWordlist(QString const&)':
spellchecker.cpp:(.text+0xf7e): undefined reference to `Hunspell::add(char const*)'
spellchecker.o: In function `hunspell::SpellChecker::loadDictionary(QString const&)':
spellchecker.cpp:(.text+0x1093): undefined reference to `Hunspell::~Hunspell()'
spellchecker.cpp:(.text+0x12e7): undefined reference to `Hunspell::Hunspell(char const*, char const*, char const*)'
spellchecker.cpp:(.text+0x132e): undefined reference to `Hunspell::get_dic_encoding()'
Owner

cloose commented Jan 18, 2014

Interesting. The CI build (travis-ci.org) uses Ubuntu. So Ubuntu should definitely work.

The following script is used to build on Ubuntu: https://github.com/cloose/CuteMarkEd/blob/develop/.travis.yml

As far as I remember you have to set the LD_LIBRARY_PATH, so that the system picks up your local libraries.

Contributor

Slesa commented Jan 18, 2014

Well - it works because the yml script installs the libraries :)
But in theory, this should not be necessary. There are two .so libraries as dependencies, it should be possible to link against them with an adequate LD_PATH. At the end of the build process, there should be an package, which can be installed and uninstalled, shouldn't it?

Contributor

Slesa commented Jan 18, 2014

I changed the app.pro so that the path to hunspell and discount is added to the library path. Now I get

spellchecker.o: In function `hunspell::SpellChecker::~SpellChecker()':
spellchecker.cpp:(.text+0x35): undefined reference to `Hunspell::~Hunspell()'
spellchecker.o: In function `hunspell::SpellChecker::isCorrect(QString const&)':
spellchecker.cpp:(.text+0xdc): undefined reference to `Hunspell::spell(char const*, int*, char**)'

and a few more. Are you sure that hunspell is not installed from the packaging on the system, and this is preferred in the lib path?

Contributor

Slesa commented Jan 21, 2014

There is definitively something going wrong...

In app.pro, I removed the PKGCONFIG line for hunspell. Instead, I added the unix part

# hunspell
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/hunspell/lib/ -lhunspell
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../3rdparty/hunspell/lib/ -lhunspell
else:unix: LIBS += -L$$OUT_PWD/../3rdparty/hunspell/lib/ -Llibhunspell

and I still get the unresolved externals mentioned above. Ok, no problem, use the install script (which doesn't make a difference. It would copy the file with the same unresolveds, but anyway...). cd 3rdparty/hunspell && make install - 'Nothing to be done for install'. Of course, the install target in the Makefile is empy. Ok ok, what about sudo apt-get install libhunspell-dev? - 'Selecting previously unselected package... installed'.

ls /usr/bin/hunspell - [ok]
ls /usr/share/hunspell/de_DE, fr_FR, fr_LU etc... [ok]
ls /usr/lib/hu* - no such file or directory

Holy towel - what has to be done to work with hunspell?

Owner

cloose commented Jan 22, 2014

else:unix: LIBS += -L$$OUT_PWD/../3rdparty/hunspell/lib/ -Llibhunspell

  1. you used -L (uppercase) to specify the library but this is the flag for library paths. You need to use -l (lowercase)
  2. AFAIK, libraries on Linux are called libsomething.so but you only specify something for the linker flag. So please try it with -lhunspell
Contributor

Slesa commented Jan 22, 2014

If I remember right, -L is also used for dynamic linking, while -l is for static libs.

It is a bit strange that there is this distinction between unix and windows at all. Shouldn't there be a big part with LIBS += hunspell etc... ? Then Qt should do the stuf for us.

Contributor

Slesa commented Jan 22, 2014

You should consider to disable some Qt modules via CONFIG -= ... I can't see so far any sense to support Sql stuff.

Owner

cloose commented Jan 22, 2014

Sorry but I don't think it will work. Not CuteMarkEd depends on QtSql but one of the Qt modules. If I remember correctly it was Qt WebKit that depends on QtSql.

Contributor

Slesa commented Jan 22, 2014

Ah ok. Yes, you're right, it is QWebKit. And it depends on QSensors. I assume, I'll find a reason for OpenGL too somewhere. Qt4 was somehow more modularized :/

@cloose cloose added the bug label Apr 7, 2015

Owner

cloose commented Apr 7, 2015

I expect the problems to big fixed since there were quite some changes to the build system. If not, I need more and especially newer information.

@cloose cloose closed this Apr 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment