Unsolved How to use Qt libraries in a non-Qt project
-
Dear all,
I have a C++ project in QtCreator that uses a qbs file to setup all libraries included in the project. The project works well as it is.
I am working on MacOS Ventura and I would like to use Qt widgets and Qt windowing system as an interface but I don't know how to link Qt headers and frameworks to the project.Could anyone provide any hints?
Thank you very much,
w -
@wasawi2 said in How to use Qt libraries in a non-Qt project:
Could anyone provide any hints?
Use a proper build system like qbs, qmake or cmake and let those apps do the work for you finding and linking the correct libs.
-
@Christian-Ehrlicher "I have a C++ project in QtCreator that uses a qbs"
-
@jsulm So where is the problem then?
-
@Christian-Ehrlicher How to add Qt libs to the project (I never used QBS, so don't have an answer).
-
Hi,
Did you already went through the Qbs introduction ?
-
@SGaist thank you very much for the suggestion.
I had a look at it but it seems to have an overwhelming amount of information.
It would be great if someone could give a bit of guidance. My guess is that including Qt libraries must be a matter of 5 to 10 lines of QBS code, am I right?If anyone can give a little help it would be very much appreciated.
Thank you,
w -
@wasawi2 did you try the minimal hello world hinted on that page linked ?
Application { name: "helloworld" files: ["main.cpp"] Depends { name: "Qt.core" } Depends { name: "cpp" } cpp.optimization: "ludicrousSpeed" }
-
thank you,
At the end It was just including these few lines what made the trick.
I don't understand at all how QtCreator finds the header files and frameworks but it seems to work out.Thanks again,
wDepends { name: "Qt.core" } Depends { name: "Qt.widgets" } Depends { name: "Qt.gui" } Depends { name: "Qt.opengl" }