PDA

View Full Version : Problem building a Qt browser on Mac Lion




PaulFXH
Mar 19, 2012, 09:13 AM
I'm trying to build a Qt-based browser on OS X 10.7.3 using the source code from the developer in Git format.
I have installed Xcode 4.3.1 including the command line tools.
I have also downloaded and installed Qt 4.8.0 from Qt.mpkg.
The build instructions are no more than run the following three commands:

qmake
make
sudo make install

Note that with the very same source code, these three commands work perfectly in Ubuntu Linux.

However, although qmake seems to do something on the Mac, when I try the make command, I get this output:

make: *** No targets specified and no makefile found. Stop.

Perhaps I don't quite have the correct Qt tools.
Can anybody suggest where I might be going wrong?



thundersteele
Mar 19, 2012, 01:29 PM
Are you executing make/qmake in the correct directory? Is there a makefile in the directory?

PaulFXH
Mar 19, 2012, 03:22 PM
Are you executing make/qmake in the correct directory? Is there a makefile in the directory?
Thanks for your reply.
Yes, I was trying the qmake command from the correct directory. However, no makefiles were produced.

I learned later that qmake in OS X by default does not produce makefiles, but rather .xcode files.
To change the default behavior so that makefiles are produced, you need to run:

qmake -spec macx-g++

This worked fine for me and the make command now initiated the build.
However, the compilation errored out and gave a whole block of error messages of this type:

src/lib/adblock/adblockblockednetworkreply.h:49:25: error: QNetworkReply: No such file or directory

It seems perhaps that the QtNetwork headers are not being included in the compile.
Anybody know how to fix this?

thundersteele
Mar 19, 2012, 03:37 PM
Anybody know how to fix this?

My usual way to fix compiler errors is to copy the error message and paste it to google. Check if the following helps (first google hit):

http://stackoverflow.com/questions/6121439/error-qnetworkreply-no-such-file-or-directory

PaulFXH
Mar 20, 2012, 04:09 AM
My usual way to fix compiler errors is to copy the error message and paste it to google. Check if the following helps (first google hit):

http://stackoverflow.com/questions/6121439/error-qnetworkreply-no-such-file-or-directory

Thanks again for your reply.
I use the very same method to fix not just compiler errors, but errors in general.
I had even seen the article to which you linked.
This time, however, I decided to read it a little more closely and followed what worked in the article by adding

qt += network
qt += webkit

to the browser.pro file in my source code.
And, amazingly, this removed the previous error.:)
But, the compile still stopped due to another error :(
This time the first part of the error was:

In file included from src/lib/app/mainapplication.cpp:43:
src/lib/other/databasewriter.h:22:21: error: QSqlQuery: No such file or directory
In file included from src/lib/app/mainapplication.cpp:43:
src/lib/other/databasewriter.h:33: error: expected ‘,’ or ‘...’ before ‘&’ token
src/lib/other/databasewriter.h:33: error: ISO C++ forbids declaration of ‘QSqlQuery’ with no type
src/lib/other/databasewriter.h:41: error: ‘QSqlQuery’ was not declared in this scope

It seems I have some serious "infrastructural" problems with the way Qt is set up on my Mac.
I think I need to do some housekeeping and try again.

Thanks a lot for your help.