[Scons-users] Qt5 build on OSX

Philipp Kraus philipp.kraus at tu-clausthal.de
Tue Nov 4 07:18:00 EST 2014


Am 04.11.2014 um 12:41 schrieb Dirk Bächle <tshortik at gmx.de>:

> Hi Phil,
> 
> On 04.11.2014 11:37, Philipp Kraus wrote:
>> Hello,
>> 
>> I try to build a Qt 5 application on OSX 10.9 with https://bitbucket.org/dirkbaechle/scons_qt5
>> In my case the QApplication include fails.
>> 
>> I create my environment with:
>> 
>> env = Environment(tools=["default", "qt5"], variables=vars)
>> 
>> if os.environ.has_key("QTDIR") :
>>      env["QT5DIR"] = os.environ["QTDIR"]
>>      env["ENV"]["PKG_CONFIG_PATH"] = os.path.join(env["QT5DIR"], "lib", "pkgconfig")
>> 
>> env.EnableQt5Modules(["QtCore", "QtGui“])
>> 
>> I have got installed Qt under /Application/Qt the bin & lib directory is found under /Application/Qt/5.3/clang_64 so I set the QT5DIR to this path.
> I don't see that you're doing this in the code snippet above, so your two statements "I create my environment with" and "I set the QT5DIR to..." are contradicting each other, at least from my point of view.
> 
> Please, (as always), post the exact SConstruct that you use. This ensures that other people can reproduce your problem, or at least understand it faster. And this will save *you* time in the long run, because you don't have to explain again and correct yourself over and over, okay?

On https://drive.google.com/open?id=0B8Ca7kayrO57WFoxSGQ2MDBia0U&authuser=0 you get my short example with CPP code
I have set a environmental variable QTDIR which points to my Qt directory in my case /Application/Qt/5.3/clang_64


> 
> It would also be nice if you could let us see the exact (full!) error message that you get. In addition, I don't know what to make of that "lib/QtCore.framework/Headers" path to the Framework headers, what's the absolute path of it?

Sure:

g++ -o main.o -c -O2 -std=c++11 -Wall -DQT_CORE_LIB -DQT_GUI_LIB -I/Applications/Qt/5.3/clang_64/include/QtGui -I/Applications/Qt/5.3/clang_64/include -I/Applications/Qt/5.3/clang_64/include/QtCore -F/Applications/Qt/5.3/clang_64/lib main.cpp
main.cpp:1:10: fatal error: 'QApplication' file not found
#include <QApplication>
         ^
1 error generated.


> 
> Finally, please note that setting environment variables like PKG_CONFIG_PATH *after* you load the Tool with "tools=['default','qt5']" won't have the desired effect.

Thanks I replace it in my SConstruct

Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141104/4af4c5ba/attachment-0001.html>


More information about the Scons-users mailing list