Problem building a Qt browser on Mac Lion

Discussion in 'Mac Programming' started by PaulFXH, Mar 19, 2012.

  1. macrumors member

    Joined:
    Aug 31, 2007
    #1
    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?
     
  2. macrumors 68030

    Joined:
    Oct 19, 2011
    Location:
    Switzerland
    #2
    Are you executing make/qmake in the correct directory? Is there a makefile in the directory?
     
  3. thread starter macrumors member

    Joined:
    Aug 31, 2007
    #3
    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?
     
  4. macrumors 68030

    Joined:
    Oct 19, 2011
    Location:
    Switzerland
    #4
  5. thread starter macrumors member

    Joined:
    Aug 31, 2007
    #5
    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

    Code:
    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:

    Code:
    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.
     

Share This Page