Discussion Forum

Please or Register to create posts and topics.

Missing HunSpellClient when using clang instead of g++

Continuing on the previous message, I was investigating what is missing. As mentioned in the previous post, the symbol that was missing was HunspellClient::HunspellClient(QObject*); which is in the sources/sonnet/src/hunspellclient.cpp. This made me believe that this is not an ABI compatibility issue (clang vs. g++). Here is what I have till now

As mentioned in the readme.md, I have libhunspell-dev version 1.6.2-1. So I tried enabling the

#define USE_OLD_HUNSPELL_API 0
in the config-hunspell.h. This does not make a difference as far as building is concerned - the build fails whether it is 1 or 0 with clang

Then I checked the compiler output to see what is the difference, and then I see that the compilation doesn't seem to be compiling the hunspellclient.cpp at all with clang

~/code$ ./diff-dirs.sh build-scrite-Desktop_Qt_5_15_1_GCC_64bit-Profile/ scrite-profile-clang/
< hunspellclient.o
< hunspelldebug.o
< hunspelldict.o
< moc_hunspellclient.cpp
< moc_hunspellclient.o
(The scrite-profile-clang folder is the folder which has the files post the compilation with clang)

I checked the compiler output for gcc vs. clang and I see this for gcc, but _no_ compilation entries in clang
g++ -c -pipe -O2 -g -Wall -Wextra -D_REENTRANT -fPIC -DPHTRANSLATE_STATICLIB -DQT_NO_DEBUG_OUTPUT -DSONNETUI_EXPORT= -DSONNETCORE_EXPORT= -DINSTALLATION_PLUGIN_PATH= -DSONNET_STATIC -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I../scrite -I. -I../scrite -I../scrite/src -I../scrite/src/core -I../scrite/src/importers -I../scrite/src/exporters -I../scrite/src/printing -I../scrite/src/quick -I../scrite/src/quick/objects -I../scrite/src/quick/items -I../scrite/src/utils -I../scrite/src/document -I../scrite/src/interfaces -I../scrite/src/reports -I../scrite/src/automation -I../scrite/3rdparty/sonnet -I../scrite/3rdparty/sonnet/sonnet/src/core -I../scrite/3rdparty/sonnet/sonnet/src/plugins -I../scrite/3rdparty/sonnet/sonnet/src/plugins/nsspellchecker -I/usr/include/hunspell -I../../tools/Qt/5.15.1/gcc_64/include -I../../tools/Qt/5.15.1/gcc_64/include/QtQuickControls2 -I../../tools/Qt/5.15.1/gcc_64/include/QtQuick -I../../tools/Qt/5.15.1/gcc_64/include/QtWidgets -I../../tools/Qt/5.15.1/gcc_64/include/QtGui -I../../tools/Qt/5.15.1/gcc_64/include/QtQmlModels -I../../tools/Qt/5.15.1/gcc_64/include/QtQml -I../../tools/Qt/5.15.1/gcc_64/include/QtNetwork -I../../tools/Qt/5.15.1/gcc_64/include/QtXml -I../../tools/Qt/5.15.1/gcc_64/include/QtConcurrent -I../../tools/Qt/5.15.1/gcc_64/include/QtCore -I. -I/usr/include/libdrm -I../../tools/Qt/5.15.1/gcc_64/mkspecs/linux-g++ -o moc_hunspellclient.o moc_hunspellclient.cpp
g++ -c -pipe -O2 -g -Wall -Wextra -D_REENTRANT -fPIC -DPHTRANSLATE_STATICLIB -DQT_NO_DEBUG_OUTPUT -DSONNETUI_EXPORT= -DSONNETCORE_EXPORT= -DINSTALLATION_PLUGIN_PATH= -DSONNET_STATIC -DQT_QML_DEBUG -DQT_NO_DEBUG -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_XML_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I../scrite -I. -I../scrite -I../scrite/src -I../scrite/src/core -I../scrite/src/importers -I../scrite/src/exporters -I../scrite/src/printing -I../scrite/src/quick -I../scrite/src/quick/objects -I../scrite/src/quick/items -I../scrite/src/utils -I../scrite/src/document -I../scrite/src/interfaces -I../scrite/src/reports -I../scrite/src/automation -I../scrite/3rdparty/sonnet -I../scrite/3rdparty/sonnet/sonnet/src/core -I../scrite/3rdparty/sonnet/sonnet/src/plugins -I../scrite/3rdparty/sonnet/sonnet/src/plugins/nsspellchecker -I/usr/include/hunspell -I../../tools/Qt/5.15.1/gcc_64/include -I../../tools/Qt/5.15.1/gcc_64/include/QtQuickControls2 -I../../tools/Qt/5.15.1/gcc_64/include/QtQuick -I../../tools/Qt/5.15.1/gcc_64/include/QtWidgets -I../../tools/Qt/5.15.1/gcc_64/include/QtGui -I../../tools/Qt/5.15.1/gcc_64/include/QtQmlModels -I../../tools/Qt/5.15.1/gcc_64/include/QtQml -I../../tools/Qt/5.15.1/gcc_64/include/QtNetwork -I../../tools/Qt/5.15.1/gcc_64/include/QtXml -I../../tools/Qt/5.15.1/gcc_64/include/QtConcurrent -I../../tools/Qt/5.15.1/gcc_64/include/QtCore -I. -I/usr/include/libdrm -I../../tools/Qt/5.15.1/gcc_64/mkspecs/linux-g++ -o moc_hunspellclient.o moc_hunspellclient.cpp

I need to check why in clang the moc_hunspellclient.cpp is not getting compiled. I don't know enough about the moc in Qt and will try to post more details as I uncover.

Anyone has ideas about any #define that is different for the moc with clang, please do post here.

Thank You

P.S: it will really help if the Wordpress had a code plugin for bulk code paste.


 

@gnittala: Ah! We did not pay attention to 'clang' when you commented about this before. At the moment, we don't have an answer for this. We are using g++ for our Linux builds. After we finish closing some tickets in the backlog, we will get around to trying clang and update our findings on this ticket.