3

I am trying to build a qbs-based Qt application with Qt Creator and I get the following errors:

 cannot find -lC:/SDKs/Qt/5.3/mingw482_32/lib/Qt5Cored
 cannot find -lC:/SDKs/Qt/5.3/mingw482_32/lib/Qt5Guid
 cannot find -lC:/SDKs/Qt/5.3/mingw482_32/lib/Qt5Widgetsd

This is my Qbs project:

import qbs

Product {
    type: "application" // To suppress bundle generation on Mac
    name: "test_ResourceFileManager"

    Depends { name: "cpp" }
    cpp.cppFlags: "-std=c++11"

    Depends {
        name: "Qt";
        submodules: ["core", "gui", "widgets"]
    }

    files: [
        "src/main.cpp",
        "src/forms/mainwindow.h",
        "src/forms/mainwindow.cpp",
        "src/forms/mainwindow.ui"
    ]

    Group {     // Properties for the produced executable
        fileTagsFilter: product.type
        qbs.install: true
    }
}

I cannot find anywhere a working example of how to write a proper Qbs project for a Qt application.

Jake Petroules
  • 23,472
  • 35
  • 144
  • 225
Zingam
  • 4,498
  • 6
  • 28
  • 48
  • 2
    This is a known issue (https://bugreports.qt-project.org/browse/QBS-688). Also, don't use `cpp.cppFlags: "-std=c++11"` -- that's for preprocessor flags, not C++ compiler flags (that would be cxxFlags). A better way to set the language version is `cpp.cxxLanguageVersion: "c++11"` – Jake Petroules Sep 19 '14 at 19:59
  • That's not even documented: https://qt.gitorious.org/qt-labs/qbs/commit/50d946443aed1898b6e7b5258289f0cb06a55108 Do you have any idea what is the difference between cppFlags and cxxFlags then? – Zingam Sep 20 '14 at 16:01
  • 1
    cpp.cxxLanguageVersion *is* documented, and indeed it's the first part of the diff in the link you just posted (documentation is also here: http://qt-project.org/doc/qbs-1.3/cpp-module.html). I also *just* explained what cppFlags was for in my last comment -- preprocessor flags. – Jake Petroules Sep 20 '14 at 23:14
  • 1
    @JakePetroules cpp.cxxLanguageVersion is still not available in Qt Creator 3.3 beta1 (C:\Users\HGH\Documents\Development\Qt Projects\untitled\CryptoPhone.qbs:9: error: Property 'cxxLanguageVersion' is not declared.) As it is not documented in that link (I cannot find it). – Zingam Nov 01 '14 at 19:04
  • cpp.cxxLanguageVersion is available in qbs 1.4 and above. – Jake Petroules May 14 '16 at 04:26

0 Answers0