Closed zzs213 closed 3 years ago
I'm using Ubuntu-20.04. And build it using the flowwing commands:
But it failed. It seems that postdatagen.cpp not added to Cmakelist.txt. The flowwing is the build output
[ 2%] Automatic MOC for target PacketSender [ 2%] Built target PacketSender_autogen [ 4%] Generating ui_udpflooding.h [ 7%] Generating moc_about.cpp [ 9%] Generating moc_brucethepoodle.cpp [ 11%] Generating moc_mainwindow.cpp [ 14%] Generating moc_persistentconnection.cpp [ 16%] Generating moc_settings.cpp [ 19%] Generating moc_udpflooding.cpp [ 21%] Generating qrc_packetsender.cpp [ 23%] Generating ui_about.h [ 26%] Generating ui_brucethepoodle.h [ 28%] Generating ui_cloudui.h [ 30%] Generating ui_mainwindow.h [ 33%] Generating ui_multicastsetup.h [ 35%] Generating ui_persistentconnection.h [ 38%] Generating ui_settings.h [ 40%] Generating ui_subnetcalc.h [ 42%] Building CXX object CMakeFiles/PacketSender.dir/PacketSender_autogen/mocs_compilation.cpp.o [ 45%] Building CXX object CMakeFiles/PacketSender.dir/qrc_packetsender.cpp.o [ 47%] Building CXX object CMakeFiles/PacketSender.dir/moc_about.cpp.o [ 50%] Building CXX object CMakeFiles/PacketSender.dir/moc_brucethepoodle.cpp.o [ 52%] Building CXX object CMakeFiles/PacketSender.dir/moc_mainwindow.cpp.o [ 54%] Building CXX object CMakeFiles/PacketSender.dir/moc_persistentconnection.cpp.o [ 57%] Building CXX object CMakeFiles/PacketSender.dir/moc_settings.cpp.o [ 59%] Building CXX object CMakeFiles/PacketSender.dir/moc_udpflooding.cpp.o [ 61%] Building CXX object CMakeFiles/PacketSender.dir/about.cpp.o [ 64%] Building CXX object CMakeFiles/PacketSender.dir/brucethepoodle.cpp.o [ 66%] Building CXX object CMakeFiles/PacketSender.dir/cloudui.cpp.o [ 69%] Building CXX object CMakeFiles/PacketSender.dir/main.cpp.o [ 71%] Building CXX object CMakeFiles/PacketSender.dir/mainwindow.cpp.o [ 73%] Building CXX object CMakeFiles/PacketSender.dir/multicastsetup.cpp.o [ 76%] Building CXX object CMakeFiles/PacketSender.dir/packet.cpp.o [ 78%] Building CXX object CMakeFiles/PacketSender.dir/packetlogmodel.cpp.o [ 80%] Building CXX object CMakeFiles/PacketSender.dir/packetnetwork.cpp.o [ 83%] Building CXX object CMakeFiles/PacketSender.dir/persistentconnection.cpp.o [ 85%] Building CXX object CMakeFiles/PacketSender.dir/sendpacketbutton.cpp.o [ 88%] Building CXX object CMakeFiles/PacketSender.dir/settings.cpp.o [ 90%] Building CXX object CMakeFiles/PacketSender.dir/subnetcalc.cpp.o [ 92%] Building CXX object CMakeFiles/PacketSender.dir/tcpthread.cpp.o [ 95%] Building CXX object CMakeFiles/PacketSender.dir/threadedtcpserver.cpp.o [ 97%] Building CXX object CMakeFiles/PacketSender.dir/udpflooding.cpp.o [100%] Linking CXX executable PacketSender /usr/bin/ld: CMakeFiles/PacketSender.dir/mainwindow.cpp.o: in function MainWindow::on_genPostDataButton_clicked()': mainwindow.cpp:(.text+0x1a33d): undefined reference toPostDataGen::PostDataGen(QWidget, QString)' /usr/bin/ld: mainwindow.cpp:(.text+0x1a35c): undefined reference to PostDataGen::postGenerated(QString)' /usr/bin/ld: CMakeFiles/PacketSender.dir/mainwindow.cpp.o: in functionMainWindow::on_generatePanelButton_clicked()': mainwindow.cpp:(.text+0x1a8c4): undefined reference to `PanelGenerator::PanelGenerator(QWidget)' /usr/bin/ld: mainwindow.cpp:(.text+0x1aa1e): undefined reference to PanelGenerator::init(QList<Packet>)' /usr/bin/ld: CMakeFiles/PacketSender.dir/mainwindow.cpp.o: in functionMainWindow::on_actionPanel_Generator_triggered()': mainwindow.cpp:(.text+0x1ac23): undefined reference to PanelGenerator::PanelGenerator(QWidget*)' /usr/bin/ld: mainwindow.cpp:(.text+0x1ac33): undefined reference toPanelGenerator::initAutoLaunchOrEditMode()' /usr/bin/ld: CMakeFiles/PacketSender.dir/mainwindow.cpp.o: in function std::enable_if<QtPrivate::FunctionPointer<MainWindow::on_genPostDataButton_clicked()::{lambda(QString)#1}>::ArgumentCount==(-1), QMetaObject::Connection>::type QObject::connect<void (PostDataGen::*)(QString), MainWindow::on_genPostDataButton_clicked()::{lambda(QString)#1}>(QtPrivate<void (PostDataGen::*)(QString)>::Object const*, std::enable_if<QtPrivate::FunctionPointer<MainWindow::on_genPostDataButton_clicked()::{lambda(QString)#1}>::ArgumentCount==(-1), QMetaObject::Connection>::type, QObject const*, QtPrivate::FunctionPointer, Qt::ConnectionType)': mainwindow.cpp:(.text+0x1ad0e): undefined reference toPostDataGen::staticMetaObject' collect2: error: ld returned 1 exit status
MainWindow::on_genPostDataButton_clicked()': mainwindow.cpp:(.text+0x1a33d): undefined reference to
PostDataGen::postGenerated(QString)' /usr/bin/ld: CMakeFiles/PacketSender.dir/mainwindow.cpp.o: in function
PanelGenerator::init(QList<Packet>)' /usr/bin/ld: CMakeFiles/PacketSender.dir/mainwindow.cpp.o: in function
PanelGenerator::PanelGenerator(QWidget*)' /usr/bin/ld: mainwindow.cpp:(.text+0x1ac33): undefined reference to
std::enable_if<QtPrivate::FunctionPointer<MainWindow::on_genPostDataButton_clicked()::{lambda(QString)#1}>::ArgumentCount==(-1), QMetaObject::Connection>::type QObject::connect<void (PostDataGen::*)(QString), MainWindow::on_genPostDataButton_clicked()::{lambda(QString)#1}>(QtPrivate<void (PostDataGen::*)(QString)>::Object const*, std::enable_if<QtPrivate::FunctionPointer<MainWindow::on_genPostDataButton_clicked()::{lambda(QString)#1}>::ArgumentCount==(-1), QMetaObject::Connection>::type, QObject const*, QtPrivate::FunctionPointer, Qt::ConnectionType)': mainwindow.cpp:(.text+0x1ad0e): undefined reference to
I'm using Ubuntu-20.04. And build it using the flowwing commands:
But it failed. It seems that postdatagen.cpp not added to Cmakelist.txt. The flowwing is the build output