Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] qmake subdirs odd behaviour on OSX
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] qmake subdirs odd behaviour on OSX

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rtbo59
    wrote on last edited by
    #1

    Hello

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

    here is my file tree
    @myproj/
    --myproj.pro
    --myapp/
    ----myapp.pro
    ----main.cc
    --libs/
    ----mylib/
    ------mylib.pro
    ------mylib.h
    ------mylib.cc@

    the pro files are quite straight-forward:
    @myproj.pro:
    TEMPLATE = subdirs
    CONFIG += ordered
    SUBDIRS += libs/mylib myapp
    message("myproj")

    myapp.pro:
    TEMPLATE = app
    TARGET = myapp
    message("myproj/myapp")

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

    SOURCES += main.cc

    mylib.pro:
    TEMPLATE = lib
    TARGET = mylib
    message("myproj/libs/mylib")

    SOURCES = mylib.cc
    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 myproj.pro (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 myproj.app/Contents/MacOS/myproj -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: *** [myproj.app/Contents/MacOS/myproj] Error 1@
    reverting to previous myproj.pro 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 !

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rtbo59
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved