DiskImagery64 icon indicating copy to clipboard operation
DiskImagery64 copied to clipboard

Compiling for macOS Big Sur

Open og2t opened this issue 3 years ago • 5 comments

I've managed to almost compile the binary for macOS Bug Sur:

Installed QT:

brew install qt

Edited the project.pro and replace the QMAKE_MAC_SDK path to: QMAKE_MAC_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

Finally run make...

But then got these errors:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -fPIC -std=gnu++1z  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -mmacosx-version-min=11 -Wall -Wextra -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../base -I/usr/local/lib/QtNetwork.framework/Headers -I/usr/local/lib/QtCore.framework/Headers -I. -I/usr/local/share/qt/mkspecs/macx-clang -F/usr/local/lib -o netdrivedevice.o netdrivedevice.cpp
netdrivedevice.cpp:146:29: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare]
    if ((openMode != WRITE) || (openMode != APPEND)) {
        ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
netdrivedevice.cpp:218:5: error: unknown type name 'QRegExp'
    QRegExp globPat(glob, Qt::CaseSensitive, QRegExp::Wildcard);
    ^
netdrivedevice.cpp:218:46: error: use of undeclared identifier 'QRegExp'
    QRegExp globPat(glob, Qt::CaseSensitive, QRegExp::Wildcard);
                                             ^
netdrivedevice.cpp:301:15: error: no member named 'sprintf' in 'QString'; did you mean 'asprintf'?
    m_message.sprintf("%02d,%s,00,00", msg, txt);
              ^~~~~~~
              asprintf

Investigating...

og2t avatar Oct 21 '21 18:10 og2t

Got passed through these but stuck again with #include <QDirModel> – it should exist in [email protected]_1.big_sur.bottle.tar.gz. Seems it's been obsolete: https://www.qt.io/blog/2010/01/08/qdirmodel-is-now-obsolete-qfilesystemmodel-is-taking-the-job

og2t avatar Oct 21 '21 18:10 og2t

same on Mac Monteray 12.1

first ran cmake then make

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -O2 -fPIC -std=gnu++1z  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -mmacosx-version-min=12 -Wall -Wextra -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../base -I/usr/local/lib/QtNetwork.framework/Headers -I/usr/local/lib/QtCore.framework/Headers -I. -I/usr/local/share/qt/mkspecs/macx-clang -F/usr/local/lib -o netdrivedevice.o netdrivedevice.cpp

netdrivedevice.cpp:146:29: warning: overlapping comparisons always evaluate to true [-Wtautological-overlap-compare]
    if ((openMode != WRITE) || (openMode != APPEND)) {
        ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
netdrivedevice.cpp:218:5: error: unknown type name 'QRegExp'
    QRegExp globPat(glob, Qt::CaseSensitive, QRegExp::Wildcard);
    ^

netdrivedevice.cpp:218:46: error: use of undeclared identifier 'QRegExp'
    QRegExp globPat(glob, Qt::CaseSensitive, QRegExp::Wildcard);
                                             ^

netdrivedevice.cpp:301:15: error: no member named 'sprintf' in 'QString'; did you mean 'asprintf'?
    m_message.sprintf("%02d,%s,00,00", msg, txt);
              ^~~~~~~
              asprintf
/usr/local/lib/QtCore.framework/Headers/qstring.h:502:20: note: 'asprintf' declared here
    static QString asprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(1, 2);
                   ^
1 warning and 3 errors generated.
make[1]: *** [netdrivedevice.o] Error 1
make: *** [sub-net-make_first] Error 2

DannyCork avatar Jan 04 '22 22:01 DannyCork

alright, I have some time this weekend free to investigate compilation under MacOS thanks for the info

ProbablyNotArtyom avatar Jan 09 '22 08:01 ProbablyNotArtyom

excellent !

DannyCork avatar Jan 13 '22 15:01 DannyCork

Would it be possible to add a homebrew formula for this project?

Brog33 avatar May 23 '23 08:05 Brog33