CCC
CCC

Reputation: 2242

Setup SUBDIRS template failed in QtCreator

The project is application(.pro) with a static library(.pro), so I am going to use TEMPLATE = SUBDIRS to manage it.

my workspace.pro

TEMPLATE = SUBDIRS
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

SUBDIRS += \
    MY_LIB \
    MY_APP1

MY_LIB.file=/Users/username/MYLIB/mylib.pro
MY_APP1.file=/Users/username/MYAPP/App1/App1.pro

The workspace.pro file is in /Users/username/MYAPP/ directory.

When I tried to build it, QtCreator gave error WARNING: Unable to generate output for: /Users/username/MYAPP/build-workspace_Qt_5_1_0_clang_64bit-Debug/Makefile [TEMPLATE SUBDIRS]

May I know how to solve it? and why it happen? Thanks.

Upvotes: 6

Views: 1612

Answers (2)

László Papp
László Papp

Reputation: 53175

Use TEMPLATE = subdirs instead of TEMPLATE = SUBDIRS, i.e. not upper case letters.

See the documentation for further details. You should have written this instead:

TEMPLATE = subdirs
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

SUBDIRS += \
    MY_LIB \
    MY_APP1

MY_LIB.file=/Users/username/MYLIB/mylib.pro
MY_APP1.file=/Users/username/MYAPP/App1/App1.pro

Upvotes: 5

CCC
CCC

Reputation: 2242

It should be TEMPLATE = subdirs, not SUBDIR.

Upvotes: 8

Related Questions