Fedorov7890
Fedorov7890

Reputation: 1255

qbs.h not found while compiling Qt Creator 4.7.0 from source on Mac

I'm trying to compile Qt Creator from source on MacOS 10.13 from the following repository: https://github.com/qt-creator/qt-creator

I followed the instructions in README.md but had no success. Most likely I missed out something.

Steps that I've done:

From that directory ran following commands:

export LLVM_INSTALL_DIR=/usr/local/opt/llvm
export QBS_INSTALL_DIR=/usr/local/opt/qbs

PATH=/usr/local/opt/qt/bin:/usr/local/opt/llvm/bin:$PATH

qmake -r /Users/username/builds/qtcreator_src/4.7 
    make

After approximately 40 minutes of compilation I get following error:

../../../../qtcreator_src/4.7/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp:29:10: fatal error: 'qbs.h' file not found
#include <qbs.h>

(I checked that the file is present in /usr/local/opt/qbs/include/qbs directory).

One more question. If I use make -j8, that boosts the build process, but then I end up with following obscure error:

mv -f libDebugger.dylib ../../../bin/Qt\ Creator.app/Contents/PlugIns/ 
make[1]: *** [sub-plugins-make_first-ordered] Error 2

I could find neither additional error messages in the console output above, nor any error.log files.

P.S. Here are original build instructions from github README.md:

# Optional, needed for the Clang Code Model if llvm-config is not in PATH:
export LLVM_INSTALL_DIR=/path/to/llvm (or "set" on Windows)
# Optional, needed to let the QbsProjectManager plugin use system Qbs:
export QBS_INSTALL_DIR=/path/to/qbs
# Optional, needed for the Python enabled dumper on Windows
set PYTHON_INSTALL_DIR=C:\path\to\python

cd $SOURCE_DIRECTORY
qmake -r
make (or mingw32-make or nmake or jom, depending on your platform)

Installation ("make install") is not needed. It is however possible, using

make install INSTALL_ROOT=$INSTALL_DIRECTORY

Update 2: after excluding Qt from PATH I receive another error:

In file included from ../../../../qtcreator_src/4.7/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp:29:
/usr/local/Cellar/qbs/1.12.0/include/qbs/qbs.h:63:10: fatal error: 
      'tools/settingsrepresentation.h' file not found
#include "tools/settingsrepresentation.h"

Update 3: I managed to build Qt Creator with the following commands issued from the build directory:

export LLVM_INSTALL_DIR=/usr/local/opt/llvm
/usr/local/opt/qt/bin/qmake /Users/username/builds/qtcreator_src/4.7
make

But even though build process completed without errors, the application doesn't run:

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libBookmarks.dylib              0x0000000115166cb0 Bookmarks::Internal::BookmarksPlugin::~BookmarksPlugin() + 32
1   libExtensionSystem.4.7.0.dylib  0x000000010b58b3eb ExtensionSystem::Internal::PluginSpecPrivate::kill() + 27
2   libExtensionSystem.4.7.0.dylib  0x000000010b576778 ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins() + 888
3   org.qt-project.qtcreator        0x000000010b558159 main + 13353
4   libdyld.dylib                   0x00007fff7e352115 start + 1

Upvotes: 0

Views: 264

Answers (1)

Qt for sure shouldn’t be in the path — it’s superfluous. You can have multiple Qt versions coexisting and they are selected by invoking their respective qmake’s. Whether LLVM should be — not sure. qmake’s -r option is for the project mode and unnecessary.

cd build_dir
/qt/bin/qmake /path/to/sources
make

The whole point of using qbs would be that you replace qmake+make with just qbs. First tell qbs about the Qt version you want to use (do this just once):

qbs setup-qt /qt/bin/qmake myqt
qbs config defaultProfile myqt

Of course myqt can be whatever you want it to be.

Then build creator:

cd build_dir
qbs -f /path/to/sources

Upvotes: 1

Related Questions