Important: Please read the Qt Code of Conduct -

[SOLVED] qmake subdirs odd behaviour on OSX

  • Hello

    I wanted to start a new subdirs project on OSX with Qt 4.7.3

    here is my file tree

    the pro files are quite straight-forward:
    TEMPLATE = subdirs
    CONFIG += ordered
    SUBDIRS += libs/mylib myapp
    TEMPLATE = app
    TARGET = myapp

    INCLUDEPATH += ../libs/mylib
    LIBS += -lmylib

    SOURCES +=
    TEMPLATE = lib
    TARGET = mylib

    HEADERS = mylib.h@

    The first problem was that mylib was considered as an app and make complains about missing refs to _main

    I then edited (I added message call)
    The problem is now that qmake doesn't parse the subdirs at all (the subdir messages are not printed)
    running make gives:
    @make: Entering directory `/path/myproj'
    g++ -headerpad_max_install_names -o -F/Library/Frameworks -L/Library/Frameworks -framework QtGui -framework QtCore
    Undefined symbols:
    "_main", referenced from:
    __start in crt1.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [] Error 1@
    reverting to previous doesn't give the previous error

    A similar project structure was working fine under 4.7.2
    It looks like a bug to me. Please someone tell me if it worths bug filing

    And any help will be appreciated to make my project build !

  • The UTF-8 BOM was present in my pro files and qmake doesn't seem to like it.

    I removed them with option in QtCreator.
    All is fine now

Log in to reply