Include issues: Common/Qtilities.h

20 views
Skip to first unread message

Casey Link

unread,
Jan 22, 2012, 11:54:39 AM1/22/12
to qtil...@googlegroups.com, sup...@qtilities.com
Hello,

I've successfully built Qtilities, however integrating it into an
existing project is giving me some trouble, in particular the
includes.

I've dropped qtilities in as an in-source dependency (using the
TEMPLATE=subdirs and my_subdir.depends = qtilities). To add the
appropriate LIBS and INCLUDEPATH, I copied Qtilities.pri into my
project dir, and edited the QTILITIES_BASE variable to point to the
Qtilities dir.

This works fine for building Qtilities in my project dir, but when it
comes time to #include Qtilities headers in my project, the file
Common/Qtilities.h never appears in the include path.

To demonstrate this issue, I've created a small test case project.
Grab it and run it with:

git clone git://github.com/Ramblurr/Qtilities-Sample.git
cd Qtilities-Sample
git submodule init && git submodule update # ( or drop the qtilities
source directory in thirdparty/ named 'qtilities')
qmake
make

The specific error is:
../thirdparty/qtilities/include/QtilitiesLogging/../../src/Logging/source/Logger.h:42:23:
fatal error: Qtilities.h: No such file or directory

Assuming we are supposed to be using the headers in
QTILITIES_BASE/includes, how should that header (Common/Qtilities.h)
get into the include path?

Cheers,

Casey

Casey

unread,
Jan 22, 2012, 12:07:53 PM1/22/12
to Qtilities

Well, I should have examined Qtilities.pri better. It uses a QTILITIES
list to conditionally include modules, similiar to the QT variable.
So, unlike I presumed before, the includes weren't actually being set
correctly.

Addding 'QTILITIES = core coregui logging' to the pro file correctly
sets the includepath.

I've updated the sample project. It new serves as an example on how to
include Qtilities in a qmake project as a thirdparty dependency using
git submodules.

Best,

Casey

Jaco Naude

unread,
Jan 23, 2012, 1:29:58 AM1/23/12
to qtil...@googlegroups.com
Hi Casey

Thanks for the emails. Its always nice to get positive feedback! 

Thanks also for the ArchLinux distros. I have not got around to making distro packages and I've never done that before, so thanks for the help there. Its much appreciated. 

With regards to building Qtilities, yes you need to set up the includes using QTILITIES. I've tried to make it clear in the documentation (see http://www.qtilities.org/docs/v1_0/page_the_basics.html#basics_includes_and_namespaces), but I realise now that everyone does not necessarily open the docs straight away after they cloned the repo. Thus I've added it to the readme files in the repo as well, see this commit for details. I've added a link to your Qtilities Hello World sample repo at the end of the readme files if you don't mind.

On the issue about the $$ in Logging.pro, thanks that's fixed now: https://github.com/JPNaude/Qtilities/issues/54. Funny that it haven't given me any problems before.

Thanks again for the feedback, I hope you find Qtilities useful.

Cheers,
Jaco

--
To post to this group, send email to qtil...@googlegroups.com
To unsubscribe from this group, send email to
qtilities+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/qtilities?hl=en?hl=en



--
Jaco Naude'

Qtilities: Building blocks for Qt applications.

Reply all
Reply to author
Forward
0 new messages