Unable to do static build from Qt source on MAC
-
Dear All: I am trying to do a static build of Qt source. This seems to be needed by macqtdeploy (I am trying to package my app as a bundle).
I didconfigure -prefix ./qtbase -opensource -static -nomake tests
when I did "make" after that, I ran into some compilation issues on Mac. (I had no
issue doing this on Linux). I am using Qt-everywhere-src-5.11.2.Any tip how I can build Qt from source on MAC?
Thanks---errors-----
c/qt-everywhere-src-5.11.2/qtbase/lib -o .obj/debug/qsql_mysql.o qsql_mysql.cpp
qsql_mysql.cpp:235:9: error: unknown type name 'my_bool'
my_bool nullIndicator;
^
qsql_mysql.cpp:987:13: error: use of undeclared identifier 'my_bool'
QVector<my_bool> nullVector;
^
qsql_mysql.cpp:1001:9: error: use of undeclared identifier 'nullVector'
nullVector.resize(values.count());
^
qsql_mysql.cpp:1008:13: error: use of undeclared identifier 'nullVector'
nullVector[i] = static_cast<my_bool>(val.isNull());
^
qsql_mysql.cpp:1008:41: error: unknown type name 'my_bool'
nullVector[i] = static_cast<my_bool>(val.isNull());
^
qsql_mysql.cpp:1009:34: error: use of undeclared identifier 'nullVector'; did you mean 'nullptr'?
currBind->is_null = &nullVector[i];
^~~~~~~~~~
nullptr
qsql_mysql.cpp:1009:33: error: cannot take the address of an rvalue of type 'nullptr_t'
currBind->is_null = &nullVector[i]; -
Hi,
There's absolutely no requirements for a static build of Qt on macOS.
macdeployqt
was created to fix your application bundle with the various frameworks your application needs.As for your error, what version of MySQL are you using to build the plugin ?
-
Since the build is failing for the MySQL plugin, you likely have it somewhere
configure
found. -
i will check on that in a bit.
I have since borrowed another Mac and tried to compile same Qt version statically.
And I got different errors. Do you know what this one is about?
-- Errors --
orm/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AGL.framework/Headers -I../../../../mkspecs/macx-clang -o .obj/debug/qcocoawindow.o qcocoawindow.mm
qcocoawindow.mm:407:59: error: use of undeclared identifier 'NSEventTypeMouseMoved'; did you mean 'kEventMouseMoved'?
const auto button = e.type == NSEventTypeMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
^~~~~~~~~~~~~~~~~~~~~
kEventMouseMoved
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/CarbonEvents.h:1721:3: note:
'kEventMouseMoved' declared here
kEventMouseMoved = 5
^
qcocoawindow.mm:408:62: error: use of undeclared identifier 'NSEventTypeMouseMoved'; did you mean 'kEventMouseMoved'?
const auto eventType = e.type == NSEventTypeMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
^~~~~~~~~~~~~~~~~~~~~
kEventMouseMoved -
What version of Xcode are you using ?
-
You are going to have to update. That version of Xcode is too old to build such a recent version of Qt. Or at least the platform plugin part.
-
Current version if macOS Mojave.
-
IIRC, you need Qt 5.12. MySQL removed the use of the my_bool type at some point. The plugin has been updated.
-
Your MySQL is not outdated as the current version is 8.0.13.
As for Xcode, the current version is 10.1 IIRC.