Schachigel / DKV2

Direktkredit Verwaltung für MHS Projekte
GNU General Public License v3.0
8 stars 7 forks source link

Docker build skript fails #116

Open quazgar opened 1 month ago

quazgar commented 1 month ago

Similar to #99, for which a fix is in my local branch https://github.com/quazgar/DKV2/tree/fix-docker-build

Yet, a few objects later, building dkdbcopy.o fails because it cannot find an empty constructor for dbForeignKey:

./dist_linux_docker.sh
...
86_64-linux-gnu-g++ -c -include DKV2 -pipe -O2 -std=gnu++1z -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_USE_QSTRINGBUILDER -DGIT_COMMIT=\"c8df4c4\" -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I../DKV2 -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtPrintSupport -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtSql -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o dkdbcopy.o ../DKV2/dkdbcopy.cpp
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qdebug.h:51,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QDebug:1,
                 from ../DKV2/pch.h:10:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h: In instantiation of 'void QVector<T>::reallocData(int, int, QArrayData::AllocationOptions) [with T = dbForeignKey; QArrayData::AllocationOptions = QFlags<QArrayData::AllocationOption>]':
/usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h:682:9:   required from 'void QVector<T>::append(const T&) [with T = dbForeignKey]'
../DKV2/dbtable.cpp:26:26:   required from here
/usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h:607:33: error: no matching function for call to 'dbForeignKey::dbForeignKey()'
  607 |                                 new (dst++) T();
      |                                 ^~~~~~~~~~~~~~~
In file included from ../DKV2/dbtable.h:4,
                 from ../DKV2/helpersql.h:4,
                 from ../DKV2/dbtable.cpp:3:
../DKV2/dbfield.h:56:5: note: candidate: 'dbForeignKey::dbForeignKey(const dbfield&, const QString&, const QString&, ODOU_Action, ODOU_Action)'
   56 |     dbForeignKey(const dbfield& local, const QString& parentTable, const QString& parentField, ODOU_Action delAction =NO_ACTION, ODOU_Action updAction =NO_ACTION)
      |     ^~~~~~~~~~~~
../DKV2/dbfield.h:56:5: note:   candidate expects 5 arguments, 0 provided
../DKV2/dbfield.h:47:5: note: candidate: 'dbForeignKey::dbForeignKey(const dbfield&, const dbfield&, ODOU_Action, ODOU_Action)'
   47 |     dbForeignKey(const dbfield& local, const dbfield& parent, ODOU_Action delAction =NO_ACTION, ODOU_Action updAction =NO_ACTION)
      |     ^~~~~~~~~~~~
../DKV2/dbfield.h:47:5: note:   candidate expects 4 arguments, 0 provided
../DKV2/dbfield.h:43:8: note: candidate: 'dbForeignKey::dbForeignKey(const dbForeignKey&)'
   43 | struct dbForeignKey
      |        ^~~~~~~~~~~~
../DKV2/dbfield.h:43:8: note:   candidate expects 1 argument, 0 provided
../DKV2/dbfield.h:43:8: note: candidate: 'dbForeignKey::dbForeignKey(dbForeignKey&&)'
../DKV2/dbfield.h:43:8: note:   candidate expects 1 argument, 0 provided
make: *** [Makefile:878: dbtable.o] Error 1

I made sure to work with a clean directory (removed build-dist-linux from previous builds) before running the build command.

quazgar commented 1 month ago

This seems to be caused by line 35 in dbtable.h:

QVector<dbForeignKey> foreignKeys;

while dbfield.h clearly has no default constructor.

Schachigel commented 1 month ago

should the default constructor come from the compiler? I do not get this error on windows with MSVC.

quazgar commented 1 month ago

I don't know, it's been along time since I last really worked with C++ or Qt. Could it be a feature of MSVC vs GCC?