Hi, try using
cpp.dynamicLibraries: [ "pthread" ] instead of the cpp.cppFlags part BR, Christian ________________________________________ From: Qbs <[email protected]> on behalf of Vincent Hui <[email protected]> Sent: Thursday, July 4, 2019 8:20:09 AM To: qbs Subject: [Qbs] How to add -pthread option into projects? a bug in qbs ? Hi, I am using qbs 1.13.1. When I built a simple project generated by Qt Creator, I got an error message. "cc1plus: error: command line option ‘-pthread’ is valid for the driver but not for C++" I encountered this error too when use qbs file generated by conan to add dependency of opencv 4.0.1 to my project. How to add -pthread option into projects? Thanks, Vincent my qbs file " import qbs CppApplication { consoleApplication: true files: "main.cpp" cpp.cppFlags: ["-pthread"] Group { // Properties for the produced executable fileTagsFilter: "application" qbs.install: true qbs.installDir: "bin" } } " main.cpp " #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; return 0; } " _______________________________________________ Qbs mailing list [email protected] https://lists.qt-project.org/listinfo/qbs
