I'm working with an software using qt3. It works fine un x86-linux systems. When i tried to port it to Raspberry Pi 2 i got a weird compiler error. Google wasn't able to help me and everything i tried failed.
The error is:
cannot bind packed field '((QChar*)this)->QChar::ucs' to 'ushort&{aka short unsigned int&}'
which is refering to the following part of qstring.h
class Q_EXPORT QChar {
...
#ifdef Q_NO_PACKED_REFERENCE
ushort &unicode() { return *(&ucs); }
#else
ushort &unicode() { return ucs; } // Throws error
#endif
...
}
Of course i already tried to define Q_NO_PACKED_REFERENCE
which just moves the error to the line above. I also tried to explicitely define the architecture, float abi and cpu.
Here is my environment:
- CPU: ARMv7
- OS: Ubuntu 16.04
- Compiler: gcc/g++ 4.8.5 (Ubuntu/Linaro 4.8.5-4ubuntu2)
- Qt Version: 3.3.8b from here (tried with x11 and embedded)
If you wonder why i use qt3 and an old gcc, it's because we want to keep our source code compatible with some older systems we have in use.
My question is: What is the reason for this error and how can i fix it? (Preferably fixing without changing the qt3 header files.)