#3 Failed to build: `invalid use of incomplete type ‘Address’`

Gesloten
9 maanden geleden werd geopend door mark22k · 4 opmerkingen

When I try to build mario-dns, the following error message appears:

$ make
g++ -c -pipe -O2 -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o resolver.o resolver.cpp
resolver.cpp: In member function ‘void Resolver::convertStrToRaw(const QString&, Address&)’:
resolver.cpp:114:46: error: invalid use of incomplete type ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
  114 |     inet_pton(AF_INET6, str.toUtf8(), (void*)array.data());
      |                                              ^~~~~
In file included from /usr/include/c++/12/functional:54,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qhashfunctions.h:48,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:47,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:46,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qshareddata.h:46,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonvalue.h:45,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonobject.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QJsonObject:1,
                 from jsonanswer.h:5,
                 from resolver.h:4,
                 from resolver.cpp:2:
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
resolver.cpp: In member function ‘QString Resolver::getBase32(const Address&)’:
resolver.cpp:119:45: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’}
  119 |     return cppcodec::base32_rfc4648::encode(rawAddr.data(), ADDRIPV6_SIZE).c_str();
      |                                             ^~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
resolver.cpp: In member function ‘QString Resolver::decodeMeshToIP(const QString&)’:
resolver.cpp:134:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined
  134 |     Address rawAddr;
      |             ^~~~~~~
resolver.cpp: In member function ‘QString Resolver::getAddress(const Address&)’:
resolver.cpp:161:25: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’}
  161 |     inet_ntop(AF_INET6, rawAddr.data(), ipStrBuf, 46);
      |                         ^~~~~~~
/usr/include/c++/12/tuple:1595:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
 1595 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
resolver.cpp: In member function ‘void Resolver::toMeship(const QString&, QSharedPointer<QTextStream>, bool)’:
resolver.cpp:281:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined
  281 |     Address rawAddr;
      |             ^~~~~~~
make: *** [Makefile:410: resolver.o] Error 1
When I try to build mario-dns, the following error message appears: ``` $ make g++ -c -pipe -O2 -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o resolver.o resolver.cpp resolver.cpp: In member function ‘void Resolver::convertStrToRaw(const QString&, Address&)’: resolver.cpp:114:46: error: invalid use of incomplete type ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 114 | inet_pton(AF_INET6, str.toUtf8(), (void*)array.data()); | ^~~~~ In file included from /usr/include/c++/12/functional:54, from /usr/include/x86_64-linux-gnu/qt5/QtCore/qhashfunctions.h:48, from /usr/include/x86_64-linux-gnu/qt5/QtCore/qlist.h:47, from /usr/include/x86_64-linux-gnu/qt5/QtCore/qhash.h:46, from /usr/include/x86_64-linux-gnu/qt5/QtCore/qshareddata.h:46, from /usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonvalue.h:45, from /usr/include/x86_64-linux-gnu/qt5/QtCore/qjsonobject.h:43, from /usr/include/x86_64-linux-gnu/qt5/QtCore/QJsonObject:1, from jsonanswer.h:5, from resolver.h:4, from resolver.cpp:2: /usr/include/c++/12/tuple:1595:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 1595 | template<typename _Tp, size_t _Nm> struct array; | ^~~~~ resolver.cpp: In member function ‘QString Resolver::getBase32(const Address&)’: resolver.cpp:119:45: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’} 119 | return cppcodec::base32_rfc4648::encode(rawAddr.data(), ADDRIPV6_SIZE).c_str(); | ^~~~~~~ /usr/include/c++/12/tuple:1595:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 1595 | template<typename _Tp, size_t _Nm> struct array; | ^~~~~ resolver.cpp: In member function ‘QString Resolver::decodeMeshToIP(const QString&)’: resolver.cpp:134:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined 134 | Address rawAddr; | ^~~~~~~ resolver.cpp: In member function ‘QString Resolver::getAddress(const Address&)’: resolver.cpp:161:25: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’} 161 | inet_ntop(AF_INET6, rawAddr.data(), ipStrBuf, 46); | ^~~~~~~ /usr/include/c++/12/tuple:1595:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 1595 | template<typename _Tp, size_t _Nm> struct array; | ^~~~~ resolver.cpp: In member function ‘void Resolver::toMeship(const QString&, QSharedPointer<QTextStream>, bool)’: resolver.cpp:281:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined 281 | Address rawAddr; | ^~~~~~~ make: *** [Makefile:410: resolver.o] Error 1 ```
acetone reageerde 9 maanden geleden
Eigenaar

Hi.

A couple years later I opened a project in Qt Creator with Qt6 and built it with no problems, despite the fact that the project was written under Qt5.

In the root of the directory, building Qt projects usually looks like qmake && make or qmake6 && make (If Qt6). Which tool did you use before make?

Hi. A couple years later I opened a project in Qt Creator with Qt6 and built it with no problems, despite the fact that the project was written under Qt5. In the root of the directory, building Qt projects usually looks like `qmake && make` or `qmake6 && make` (If Qt6). Which tool did you use before `make`?
Marek Küthe reageerde 9 maanden geleden
Poster

Since Qt5 was in the README, I executed the "normal" qmake. The error appears under both Debian and Arch Linux.

┌─[marek@ciel]─[~]
└──╼ $cd git
┌─[marek@ciel]─[~/git]
└──╼ $git clone git@notabug.org:acetone/mario-dns.git
Cloning into 'mario-dns'...
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 78 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (78/78), 59.96 KiB | 739.00 KiB/s, done.
Resolving deltas: 100% (34/34), done.
┌─[marek@ciel]─[~/git]
└──╼ $cd mario-dns/
┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0)
└──╼ $qmake
Info: creating stash file /home/marek/git/mario-dns/.qmake.stash
┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0)
└──╼ $make
g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o funcs.o funcs.cpp
g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o jsonanswer.o jsonanswer.cpp
g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o main.o main.cpp
g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o resolver.o resolver.cpp
resolver.cpp: In member function ‘void Resolver::convertStrToRaw(const QString&, Address&)’:
resolver.cpp:114:46: error: invalid use of incomplete type ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
  114 |     inet_pton(AF_INET6, str.toUtf8(), (void*)array.data());
      |                                              ^~~~~
In file included from /usr/include/c++/13.2.1/functional:53,
                 from /usr/include/qt/QtCore/qhashfunctions.h:48,
                 from /usr/include/qt/QtCore/qlist.h:47,
                 from /usr/include/qt/QtCore/qhash.h:46,
                 from /usr/include/qt/QtCore/qshareddata.h:46,
                 from /usr/include/qt/QtCore/qjsonvalue.h:45,
                 from /usr/include/qt/QtCore/qjsonobject.h:43,
                 from /usr/include/qt/QtCore/QJsonObject:1,
                 from jsonanswer.h:5,
                 from resolver.h:4,
                 from resolver.cpp:2:
/usr/include/c++/13.2.1/tuple:2005:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
 2005 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
resolver.cpp: In member function ‘QString Resolver::getBase32(const Address&)’:
resolver.cpp:119:45: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’}
  119 |     return cppcodec::base32_rfc4648::encode(rawAddr.data(), ADDRIPV6_SIZE).c_str();
      |                                             ^~~~~~~
/usr/include/c++/13.2.1/tuple:2005:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
 2005 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
resolver.cpp: In member function ‘QString Resolver::decodeMeshToIP(const QString&)’:
resolver.cpp:134:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined
  134 |     Address rawAddr;
      |             ^~~~~~~
resolver.cpp: In member function ‘QString Resolver::getAddress(const Address&)’:
resolver.cpp:161:25: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’}
  161 |     inet_ntop(AF_INET6, rawAddr.data(), ipStrBuf, 46);
      |                         ^~~~~~~
/usr/include/c++/13.2.1/tuple:2005:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’}
 2005 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
resolver.cpp: In member function ‘void Resolver::toMeship(const QString&, QSharedPointer<QTextStream>, bool)’:
resolver.cpp:281:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined
  281 |     Address rawAddr;
      |             ^~~~~~~
make: *** [Makefile:794: resolver.o] Error 1
┌─[✗]─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0)
└──╼ $qmake --version
QMake version 3.1
Using Qt version 5.15.12 in /usr/lib

Compiling with qmake6 also failes (but with another error):

┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0)
└──╼ $qmake6
┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0)
└──╼ $make
g++ -c -pipe -O2 -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt6 -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o resolver.o resolver.cpp
g++ -pipe -O2 -Wall -Wextra -dM -E -o moc_predefs.h /usr/lib/qt6/mkspecs/features/data/dummy.cpp
/usr/lib/qt6/moc -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB --include /home/marek/git/mario-dns/moc_predefs.h -I/usr/lib/qt6/mkspecs/linux-g++ -I/home/marek/git/mario-dns -I/usr/include/qt6 -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I/usr/include/c++/13.2.1 -I/usr/include/c++/13.2.1/x86_64-pc-linux-gnu -I/usr/include/c++/13.2.1/backward -I/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include -I/usr/local/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include-fixed -I/usr/include resolver.h -o moc_resolver.cpp
g++ -c -pipe -O2 -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt6 -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o moc_resolver.o moc_resolver.cpp
g++ -Wl,-O1 -Wl,-rpath,/usr/lib -o mario-dns-tool  funcs.o jsonanswer.o main.o resolver.o moc_resolver.o   /usr/lib/libQt6Network.so /usr/lib/libQt6Core.so -lpthread   
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `operator+(char const*, QString const&)':
<artificial>:(.text+0x112): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `operator+(QString const&, char const*) [clone .isra.0]':
<artificial>:(.text+0x18f): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0x1de): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QDebug::operator<<(char const*) [clone .isra.0]':
<artificial>:(.text+0x2b7): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0x313): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QString::QString(char const*)':
<artificial>:(.text+0x454): undefined reference to `QString::fromAscii_helper(char const*, int)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `funcs::getValue(QString const&, QString const&)':
<artificial>:(.text+0x49c): undefined reference to `QArrayData::shared_null'
/usr/bin/ld: <artificial>:(.text+0x4fb): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0x540): undefined reference to `QString::indexOf(QString const&, int, Qt::CaseSensitivity) const'
/usr/bin/ld: <artificial>:(.text+0x554): undefined reference to `QArrayData::shared_null'
/usr/bin/ld: <artificial>:(.text+0x58b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: <artificial>:(.text+0x5af): undefined reference to `QString::indexOf(QChar, int, Qt::CaseSensitivity) const'
/usr/bin/ld: <artificial>:(.text+0x694): undefined reference to `QString::fromAscii_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0x6c3): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: <artificial>:(.text+0x6eb): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `JsonAnswer::result() const':
<artificial>:(.text+0x7fa): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0x831): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0x898): undefined reference to `QArrayData::shared_null'
/usr/bin/ld: <artificial>:(.text+0x9f6): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: <artificial>:(.text+0xa0b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: <artificial>:(.text+0xa23): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: <artificial>:(.text+0xa41): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: <artificial>:(.text+0xa5f): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: <artificial>:(.text+0xa7b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o:<artificial>:(.text+0xa93): more undefined references to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' follow
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `JsonAnswer::result() const':
<artificial>:(.text+0xaf4): undefined reference to `QString::fromUtf8_helper(char const*, int)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QString::~QString()':
<artificial>:(.text+0x29): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QByteArray::~QByteArray()':
<artificial>:(.text.unlikely+0x17): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `_sub_I_65535_0.0':
<artificial>:(.text.startup+0x1e6): undefined reference to `QArrayData::shared_null'
/usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `main':
<artificial>:(.text.startup+0x3a6): undefined reference to `QString::toInt(bool*, int) const'
collect2: error: ld returned 1 exit status
make: *** [Makefile:260: mario-dns-tool] Error 1
┌─[✗]─[marek@ciel]─[~/git/mario-dns]─(master|1 0 0)
└──╼ $qmake6 --version
QMake version 3.1
Using Qt version 6.6.1 in /usr/lib
Since Qt5 was in the README, I executed the "normal" `qmake`. The error appears under both Debian and Arch Linux. ``` ┌─[marek@ciel]─[~] └──╼ $cd git ┌─[marek@ciel]─[~/git] └──╼ $git clone git@notabug.org:acetone/mario-dns.git Cloning into 'mario-dns'... remote: Counting objects: 78, done. remote: Compressing objects: 100% (3/3), done. remote: Total 78 (delta 0), reused 0 (delta 0) Receiving objects: 100% (78/78), 59.96 KiB | 739.00 KiB/s, done. Resolving deltas: 100% (34/34), done. ┌─[marek@ciel]─[~/git] └──╼ $cd mario-dns/ ┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0) └──╼ $qmake Info: creating stash file /home/marek/git/mario-dns/.qmake.stash ┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0) └──╼ $make g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o funcs.o funcs.cpp g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o jsonanswer.o jsonanswer.cpp g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o main.o main.cpp g++ -c -pipe -O2 -std=gnu++11 -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o resolver.o resolver.cpp resolver.cpp: In member function ‘void Resolver::convertStrToRaw(const QString&, Address&)’: resolver.cpp:114:46: error: invalid use of incomplete type ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 114 | inet_pton(AF_INET6, str.toUtf8(), (void*)array.data()); | ^~~~~ In file included from /usr/include/c++/13.2.1/functional:53, from /usr/include/qt/QtCore/qhashfunctions.h:48, from /usr/include/qt/QtCore/qlist.h:47, from /usr/include/qt/QtCore/qhash.h:46, from /usr/include/qt/QtCore/qshareddata.h:46, from /usr/include/qt/QtCore/qjsonvalue.h:45, from /usr/include/qt/QtCore/qjsonobject.h:43, from /usr/include/qt/QtCore/QJsonObject:1, from jsonanswer.h:5, from resolver.h:4, from resolver.cpp:2: /usr/include/c++/13.2.1/tuple:2005:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 2005 | template<typename _Tp, size_t _Nm> struct array; | ^~~~~ resolver.cpp: In member function ‘QString Resolver::getBase32(const Address&)’: resolver.cpp:119:45: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’} 119 | return cppcodec::base32_rfc4648::encode(rawAddr.data(), ADDRIPV6_SIZE).c_str(); | ^~~~~~~ /usr/include/c++/13.2.1/tuple:2005:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 2005 | template<typename _Tp, size_t _Nm> struct array; | ^~~~~ resolver.cpp: In member function ‘QString Resolver::decodeMeshToIP(const QString&)’: resolver.cpp:134:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined 134 | Address rawAddr; | ^~~~~~~ resolver.cpp: In member function ‘QString Resolver::getAddress(const Address&)’: resolver.cpp:161:25: error: invalid use of incomplete type ‘const Address’ {aka ‘const struct std::array<unsigned char, 16>’} 161 | inet_ntop(AF_INET6, rawAddr.data(), ipStrBuf, 46); | ^~~~~~~ /usr/include/c++/13.2.1/tuple:2005:45: note: declaration of ‘Address’ {aka ‘struct std::array<unsigned char, 16>’} 2005 | template<typename _Tp, size_t _Nm> struct array; | ^~~~~ resolver.cpp: In member function ‘void Resolver::toMeship(const QString&, QSharedPointer<QTextStream>, bool)’: resolver.cpp:281:13: error: aggregate ‘Address rawAddr’ has incomplete type and cannot be defined 281 | Address rawAddr; | ^~~~~~~ make: *** [Makefile:794: resolver.o] Error 1 ┌─[✗]─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0) └──╼ $qmake --version QMake version 3.1 Using Qt version 5.15.12 in /usr/lib ``` Compiling with `qmake6` also failes (but with another error): ``` ┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0) └──╼ $qmake6 ┌─[marek@ciel]─[~/git/mario-dns]─(master|0 0 0) └──╼ $make g++ -c -pipe -O2 -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt6 -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o resolver.o resolver.cpp g++ -pipe -O2 -Wall -Wextra -dM -E -o moc_predefs.h /usr/lib/qt6/mkspecs/features/data/dummy.cpp /usr/lib/qt6/moc -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB --include /home/marek/git/mario-dns/moc_predefs.h -I/usr/lib/qt6/mkspecs/linux-g++ -I/home/marek/git/mario-dns -I/usr/include/qt6 -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I/usr/include/c++/13.2.1 -I/usr/include/c++/13.2.1/x86_64-pc-linux-gnu -I/usr/include/c++/13.2.1/backward -I/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include -I/usr/local/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/include-fixed -I/usr/include resolver.h -o moc_resolver.cpp g++ -c -pipe -O2 -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qt6 -I/usr/include/qt6/QtNetwork -I/usr/include/qt6/QtCore -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o moc_resolver.o moc_resolver.cpp g++ -Wl,-O1 -Wl,-rpath,/usr/lib -o mario-dns-tool funcs.o jsonanswer.o main.o resolver.o moc_resolver.o /usr/lib/libQt6Network.so /usr/lib/libQt6Core.so -lpthread /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `operator+(char const*, QString const&)': <artificial>:(.text+0x112): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `operator+(QString const&, char const*) [clone .isra.0]': <artificial>:(.text+0x18f): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0x1de): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QDebug::operator<<(char const*) [clone .isra.0]': <artificial>:(.text+0x2b7): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0x313): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QString::QString(char const*)': <artificial>:(.text+0x454): undefined reference to `QString::fromAscii_helper(char const*, int)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `funcs::getValue(QString const&, QString const&)': <artificial>:(.text+0x49c): undefined reference to `QArrayData::shared_null' /usr/bin/ld: <artificial>:(.text+0x4fb): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0x540): undefined reference to `QString::indexOf(QString const&, int, Qt::CaseSensitivity) const' /usr/bin/ld: <artificial>:(.text+0x554): undefined reference to `QArrayData::shared_null' /usr/bin/ld: <artificial>:(.text+0x58b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: <artificial>:(.text+0x5af): undefined reference to `QString::indexOf(QChar, int, Qt::CaseSensitivity) const' /usr/bin/ld: <artificial>:(.text+0x694): undefined reference to `QString::fromAscii_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0x6c3): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: <artificial>:(.text+0x6eb): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `JsonAnswer::result() const': <artificial>:(.text+0x7fa): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0x831): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0x898): undefined reference to `QArrayData::shared_null' /usr/bin/ld: <artificial>:(.text+0x9f6): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: <artificial>:(.text+0xa0b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: <artificial>:(.text+0xa23): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: <artificial>:(.text+0xa41): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: <artificial>:(.text+0xa5f): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: <artificial>:(.text+0xa7b): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o:<artificial>:(.text+0xa93): more undefined references to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' follow /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `JsonAnswer::result() const': <artificial>:(.text+0xaf4): undefined reference to `QString::fromUtf8_helper(char const*, int)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QString::~QString()': <artificial>:(.text+0x29): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `QByteArray::~QByteArray()': <artificial>:(.text.unlikely+0x17): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `_sub_I_65535_0.0': <artificial>:(.text.startup+0x1e6): undefined reference to `QArrayData::shared_null' /usr/bin/ld: /tmp/ccMwHZlU.ltrans0.ltrans.o: in function `main': <artificial>:(.text.startup+0x3a6): undefined reference to `QString::toInt(bool*, int) const' collect2: error: ld returned 1 exit status make: *** [Makefile:260: mario-dns-tool] Error 1 ┌─[✗]─[marek@ciel]─[~/git/mario-dns]─(master|1 0 0) └──╼ $qmake6 --version QMake version 3.1 Using Qt version 6.6.1 in /usr/lib ```
acetone verwees naar dit probleem vanuit een commit 9 maanden geleden'
acetone reageerde 9 maanden geleden
Eigenaar

let you check

let you check
Marek Küthe reageerde 9 maanden geleden
Poster

Works!

Works!
Sign in to join this conversation.
Geen label
Geen mijlpaal
Geen verantwoordelijke
2 deelnemers
Laden...
Annuleren
Opslaan
Er is nog geen inhoud.