Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile on macOS 14.6.1 fails #55

Closed
richardklingler opened this issue Aug 24, 2024 · 2 comments · May be fixed by #56
Closed

Compile on macOS 14.6.1 fails #55

richardklingler opened this issue Aug 24, 2024 · 2 comments · May be fixed by #56

Comments

@richardklingler
Copy link

Compiling on macOS 14.6.1 fails with:

hexwriter.cpp:50:26: error: calling 'GetHexLine' with incomplete return type 'QString'
outStream << GetHexLine(temp,2,0,SEGMENT_RECORD) << ENDL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./hexwriter.h:12:13: note: 'GetHexLine' declared here
QString GetHexLine(uchar data, uchar size, ushort address ,uchar recordtype);
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:52:22: error: calling 'GetHexLine' with incomplete return type 'QString'
outStream << GetHexLine(reinterpret_cast<uchar
>(&data.data()[(segment-1)*0x10000+address]),16,address,DATA_RECORD) << ENDL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./hexwriter.h:12:13: note: 'GetHexLine' declared here
QString GetHexLine(uchar data, uchar size, ushort address ,uchar recordtype);
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:56:17: error: calling 'GetHexLine' with incomplete return type 'QString'
outStream << GetHexLine(reinterpret_cast<uchar
>(&data.data()[(segment-1)*0x10000+address]), static_cast(size/2),address,DATA_RECORD) << ENDL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./hexwriter.h:12:13: note: 'GetHexLine' declared here
QString GetHexLine(uchar data, uchar size, ushort address ,uchar recordtype);
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:59:17: error: calling 'GetHexLine' with incomplete return type 'QString'
outStream << GetHexLine(reinterpret_cast<uchar
>(&data.data()[(segment-1)*0x10000+address]),static_cast(size),address,DATA_RECORD) << ENDL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./hexwriter.h:12:13: note: 'GetHexLine' declared here
QString GetHexLine(uchar *data, uchar size, ushort address ,uchar recordtype);
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:60:17: error: calling 'GetHexLine' with incomplete return type 'QString'
outStream << GetHexLine(nullptr,0,0,EOF_RECORD) << ENDL;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./hexwriter.h:12:13: note: 'GetHexLine' declared here
QString GetHexLine(uchar *data, uchar size, ushort address ,uchar recordtype);
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:64:20: error: incomplete result type 'QString' in function definition
QString HexWriter::GetHexLine(uchar *data, uchar size, ushort address, uchar recordtype)
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:66:16: error: 'QString' is an incomplete type
QString s=(QString(":%1%2%3").arg(size & 0xff, 2, 16, QChar('0')).arg(address, 4, 16, QChar('0')).arg(recordtype, 2, 16, QChar('0')).toUpper()).toLocal8Bit();
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:66:34: error: member access into incomplete type 'QString'
QString s=(QString(":%1%2%3").arg(size & 0xff, 2, 16, QChar('0')).arg(address, 4, 16, QChar('0')).arg(recordtype, 2, 16, QChar('0')).toUpper()).toLocal8Bit();
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:66:13: error: variable has incomplete type 'QString'
QString s=(QString(":%1%2%3").arg(size & 0xff, 2, 16, QChar('0')).arg(address, 4, 16, QChar('0')).arg(recordtype, 2, 16, QChar('0')).toUpper()).toLocal8Bit();
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:75:22: error: 'QString' is an incomplete type
s.append(QString("%1").arg(data[i], 2, 16, QChar('0')).toUpper());
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:75:35: error: member access into incomplete type 'QString'
s.append(QString("%1").arg(data[i], 2, 16, QChar('0')).toUpper());
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:80:14: error: 'QString' is an incomplete type
s.append(QString("%1").arg(cs, 2, 16, QChar('0')).toUpper());
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
hexwriter.cpp:80:27: error: member access into incomplete type 'QString'
s.append(QString("%1").arg(cs, 2, 16, QChar('0')).toUpper());
^
/opt/homebrew/lib/QtCore.framework/Headers/qcontainerfwd.h:36:7: note: forward declaration of 'QString'
class QString;
^
13 errors generated.
make: *** [hexwriter.o] Error 1

@plaes
Copy link

plaes commented Sep 12, 2024

Same issue on Linux distros with Qt6 as well, fix is to add #include <QString> to the hexwriter.h file:

diff --git a/TL866_Updater/QT/hexwriter.h b/TL866_Updater/QT/hexwriter.h
index bd9b757..9aea136 100644
--- a/TL866_Updater/QT/hexwriter.h
+++ b/TL866_Updater/QT/hexwriter.h
@@ -1,5 +1,6 @@
 #ifndef HEXWRITER_H
 #define HEXWRITER_H
+#include <QString>
 #include <QTextStream>
 
 class HexWriter

@richardklingler
Copy link
Author

Can confirm it compiles and runs fine (o;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants