Important: Please read the Qt Code of Conduct -

Issues building a Qt app without using qmake

  • I'm new to Qt and am experimenting with replacing a C# WinForms front-end of an already existing tool with Qt 5.11.1. The code for the tool is large and is already using a different build system (Bazel) and it doesn't make sense to convert to qmake.

    I found some pointers on building Qt apps using Bazel - including moc compiling - but the builds are failing on trying to find the Qt includes.

    Looking into my Qt install folder I can see why. There's no real rational include folder -- I can search and find my includes, but they're scattered all over the place.

    Is the fact that the headers aren't together an error with my install or is it the new way of life in Qt? Do I have to manually add each library's include path to my build system so that it can resolve them? Where are they all?

  • @nonrandom

    Your description is a bit vague in respect of include locations. What do you mean with scattered.
    On windows the includes for one version under one include c:\Qt\5.10.1\mingw53_32\include. From there are a couple of subfolders which basically reflect the different modules, I guess.
    Never checked how there are located on a linux system, I expect some similar structure.

  • You are quite correct, but I'm doing the testing on MacOS -- which is one of the reasons I'm looking to replace C# WinForms.

    On macOS the includes are "scattered" inside of each of the individual framework folders, making it troublesome properly handle include paths using a command line build system.

    If I add the include path into the framework folder then Qt internal #includes no longer work. If I add new correctly named folders soft linked from the lib folder into the Headers folder inside the framework directory the code does compile, but this is obviously a huge hack.

    I'm continuing to investigate how to properly include and link from frameworks on the command line.

  • Lifetime Qt Champion

    Hi and come to devnet,

    They are not scattered, that’s how it works on macOS, a framework provides both the libraries and includes. Even more if there are special resources that comes with it.

    You have to use the ‘-F’ and ‘-framework’ parameters for the compiler and linker to find what they want.

    Nothing Qt related here.

Log in to reply