I'm trying to compile a C++ library (libKUserFeedbackCore) which started as part of a larger project (kuserfeedback), but I don't want to download the entirety of Qt, not to mention the unrelated PHP and other crap that the CMakeLists.txt files want.
The classes I need rely solely on Qt5 Core for defining some data types.
Knowing it would fail, I ran "
g++ path/to/*.cpp" and of course that complains about "
#include <QMetaType>" with "
fatal error: QMetaType: No such file or directory" - where QMetaType is just the first example.
I installed
libqt5core5a but not sure how to point the compiler at it.
Searching found this example:
Code:
g++ -Wall -g -c $(pkg-config --cflags Qt5Gui) foo.c
Except "
pkg-config --list-all" has no Qt-related results, and replacing the command substitution with /usr/lib/x84_64-linux-gnu/libQt5Core.so.5 appeared to have no effect - it outputs same errors as before.
Based on the
g++ manual Link Options page, I might want "-L
directory -l
library"? But since it's referring to "lib
library.a" rather than "lib
library.so.
version" I'm not sure it's the right option. (Or maybe I need to get a libQt5Core.a file?)
In any case, I can't find a variant that changes behaviour - even specifying an invalid directory for -L simply returns the same errors as before with no indication of the option being there.
Can someone provide the correct version of this command?
Code:
g++ -Wall -shared SOMETHING /usr/lib/x84_64-linux/gnu/libQt5Core.so.5 src/provider/code/*.cpp
update: I read that I can use a colon to specify exact filename, i.e. "
-l :libQt5Core.so.5" but still no luck.
With "
--verbose" I can see that "
-L/usr/lib/x84_64-linux-gnu" gets added to "COLLECT_GCC_OPTIONS" but isn't added to the locations in the search list - maybe I need something inside /usr/include instead of /usr/lib ?