Error configuring SUBDIRS template in QtCreator

The project is an application (.pro) with a static library (.pro), so I'm 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 located in the /Users/username/MYAPP/ .

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

Can I find out how to solve it? and why is this happening? Thanks.

+4
source share
2 answers

It should be TEMPLATE = subdirs , not SUBDIR.

+7
source

Use TEMPLATE = subdirs instead of TEMPLATE = subdirs , i.e. not uppercase letters.

See more 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 
+3
source

Source: https://habr.com/ru/post/1498526/


All Articles