[odb-users] Build libodbc-qt on OSX with Qt5.2.1
Boris Kolpackov
boris at codesynthesis.com
Fri May 9 21:53:55 EDT 2014
Hi Adnan,
Adnan RIHAN <axel50397 at gmail.com> writes:
> Qt is not installed in system directories (/usr/include | /usr/lib) by
> default (At least on OSX and Windows), so I have to precise my lib dir
> when using clang++ (Without -F, all return errors).
>
> > clang++ -F/Users/Max13/Qt/5.2.1/clang_64/lib -c sample1.cxx
> > clang++ -F/Users/Max13/Qt/5.2.1/clang_64/lib -framework QtCore sample1.o
> OK
Then this should work for libodb-qt:
./configure CPPFLAGS=-F/Users/Max13/Qt/5.2.1/clang_64/lib
The only reason I can think of why this might not work is if libtool
doesn't pass the -F option through to clang.
> It seems to be the same after all. I wonder why I don’t have to
> prefix QtCore when including QString for example, and I
> noticed that QtCreator automatically adds every framework's headers
> directory.
Well, remember, you asked for it: ;-)
If you look around in the documentation, Qt folks tell you to include
it as <QString>. But if you look into Qt's own code, they include
everything as <QtCore/QString> (do as I say, not as I do). If we
follow their advise, to make the whole thing work, we have to add
two -I options: one that goes all the way to .../QtCore (so that our
includes compile) and one to one level up (so that the Qt's includes
compile). Except that Qt 4.x packaged as a framework only added one
-I option, the "level up" one. That's why ODB includes all the Qt
headers with the prefix. They seem to have fixed this in Qt 5.x.
To sum it all up in one word: mess.
Boris
More information about the odb-users
mailing list