[Qbs] How to add -pthread option into projects? a bug in qbs ?

Richard Weickelt richard at weickelt.de
Thu Jul 4 09:52:10 CEST 2019


> How to add -pthread option into projects?
> ...
>     cpp.cppFlags: ["-pthread"]

Try using cpp.cxxFlags or cpp.driverFlags instead. cpp.cppFlags has a
different meaning. See
https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#cppFlags-prop

> I encountered this error too when use qbs file generated by conan to add
> dependency of opencv 4.0.1 to my project.

This is a bug in the Conan Qbs generator which still exports compiler
options to cpp.cppFlags. See https://github.com/conan-io/conan/issues/4730

If you find the time to fix
https://github.com/conan-io/conan/blob/develop/conans/client/generators/qbs.py
that would be awesome. It's just two letters.

Richard


More information about the Qbs mailing list