Bug report #8575

undefined references building master

Added by Sandro Santilli over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Normal
Assignee:Radim Blazek
Category:Build/Install
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17318

Description

CMakeFiles/qgis_app.dir/main.cpp.o: In function `dumpBacktrace':
/usr/src/qgis/qgis/src/app/main.cpp:229: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
/usr/src/qgis/qgis/src/app/main.cpp:244: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
/usr/src/qgis/qgis/src/app/main.cpp:258: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
CMakeFiles/qgis_app.dir/main.cpp.o: In function `myMessageOutput(QtMsgType, char const*)':
/usr/src/qgis/qgis/src/app/main.cpp:366: undefined reference to `QgsMessageLog::logMessage(QString, QString, QgsMessageLog::MessageLevel)'
/usr/src/qgis/qgis/src/app/main.cpp:374: undefined reference to `QgsMessageLog::logMessage(QString, QString, QgsMessageLog::MessageLevel)'
CMakeFiles/qgis_app.dir/main.cpp.o: In function `main':
/usr/src/qgis/qgis/src/app/main.cpp:393: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
/usr/src/qgis/qgis/src/app/main.cpp:403: undefined reference to `qInstallMsgHandler(void (*)(QtMsgType, char const*))'
/usr/src/qgis/qgis/src/app/main.cpp:581: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
/usr/src/qgis/qgis/src/app/main.cpp:599: undefined reference to `QFileInfo::QFileInfo(QString const&)'
/usr/src/qgis/qgis/src/app/main.cpp:599: undefined reference to `QFileInfo::absoluteFilePath() const'
/usr/src/qgis/qgis/src/app/main.cpp:599: undefined reference to `QDir::convertSeparators(QString const&)'
/usr/src/qgis/qgis/src/app/main.cpp:599: undefined reference to `QString::operator=(QString const&)'
/usr/src/qgis/qgis/src/app/main.cpp:599: undefined reference to `QFileInfo::~QFileInfo()'
/usr/src/qgis/qgis/src/app/main.cpp:603: undefined reference to `QString::toInt(bool*, int) const'
/usr/src/qgis/qgis/src/app/main.cpp:607: undefined reference to `QString::toInt(bool*, int) const'
/usr/src/qgis/qgis/src/app/main.cpp:619: undefined reference to `QFileInfo::QFileInfo(QString const&)'
/usr/src/qgis/qgis/src/app/main.cpp:619: undefined reference to `QFileInfo::absoluteFilePath() const'
/usr/src/qgis/qgis/src/app/main.cpp:619: undefined reference to `QDir::convertSeparators(QString const&)'
/usr/src/qgis/qgis/src/app/main.cpp:619: undefined reference to `QString::operator=(QString const&)'
/usr/src/qgis/qgis/src/app/main.cpp:619: undefined reference to `QFileInfo::~QFileInfo()'
/usr/src/qgis/qgis/src/app/main.cpp:656: undefined reference to `QString::arg(QString const&, int, QChar const&) const'
/usr/src/qgis/qgis/src/app/main.cpp:656: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
/usr/src/qgis/qgis/src/app/main.cpp:663: undefined reference to `QgsLogger::debug(QString const&, int, char const*, char const*, int)'
/usr/src/qgis/qgis/src/app/main.cpp:670: undefined reference to `QString::arg(QString const&, int, QChar const&) const'

and many more.

This is after git pull && make

History

#1 Updated by Marco Hugentobler over 10 years ago

  • Assignee set to Radim Blazek

#2 Updated by Radim Blazek over 10 years ago

For me it compiles, Jenkins also says last successful 135ef365693f http://jenkins.linfiniti.com/job/QGIS/lastSuccessfulBuild/
i.e. after my commits.

I have not touched src/app/main.cpp, so I have no idea, for now.

#3 Updated by Matthias Kuhn over 10 years ago

I suspect it's related to the new shared lib.

At least reverting 250df51994ab7c938d5f2a27f2be843b89d97803 makes it link again here

#4 Updated by Radim Blazek over 10 years ago

I have added shared lib for classes used in main app, so that they can be used in tests. At this moment however, the main app is not using that lib and builds as before.

#5 Updated by Radim Blazek over 10 years ago

I know probably, src/app/main.cpp must be excluded from that lib.

#6 Updated by Jürgen Fischer over 10 years ago

Radim Blazek wrote:

I know probably, src/app/main.cpp must be excluded from that lib.

2c2d675 fixes it, by making it a static library, excluding main() and disabling the call to qgisCrashDump() in QGisApp. Creating a DLL from app probably needs a lot more work as each exported symbol need to marked (just like in core, gui and analysis...).

#7 Updated by Radim Blazek over 10 years ago

Thanks Jef and sorry for problems.

Should I move qgisCrashDump() from main.cpp to static QgisApp::qgisCrashDump()?

#8 Updated by Sandro Santilli over 10 years ago

Still not completely fixed as of 2c2d6757 I still get:


../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `messageOutputViewer_':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:347: undefined reference to `QgsMessageViewer::QgsMessageViewer(QWidget*, QFlags<Qt::WindowType>, bool)'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp::validateSrs(QgsCoordinateReferenceSystem&)':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:379: undefined reference to `QgsGenericProjectionSelector::QgsGenericProjectionSelector(QWidget*, QFlags<Qt::WindowType>)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:380: undefined reference to `QgsGenericProjectionSelector::setMessage(QString)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:382: undefined reference to `QgsMapCanvas::mapRenderer()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:387: undefined reference to `QgsGenericProjectionSelector::setSelectedCrsId(long)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:396: undefined reference to `QgsGenericProjectionSelector::selectedCrsId()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:397: undefined reference to `QgsGenericProjectionSelector::selectedAuthId()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:398: undefined reference to `QgsGenericProjectionSelector::selectedAuthId()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:409: undefined reference to `QgsMapCanvas::mapRenderer()'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:489: undefined reference to `QgsMapCanvas::QgsMapCanvas(QWidget*, char const*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:502: undefined reference to `QgsMessageBar::QgsMessageBar(QWidget*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:524: undefined reference to `QgsMapCanvas::freeze(bool)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:566: undefined reference to `QgsMessageLogViewer::QgsMessageLogViewer(QStatusBar*, QWidget*, QFlags<Qt::WindowType>)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:605: undefined reference to `QgsCredentialDialog::QgsCredentialDialog(QWidget*, QFlags<Qt::WindowType>)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:699: undefined reference to `QgsMapCanvas::freeze(bool)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:700: undefined reference to `QgsMapCanvas::clearExtentHistory()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:703: undefined reference to `QgsMapCanvas::mapRenderer()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:754: undefined reference to `QgsMapCanvas::QgsMapCanvas(QWidget*, char const*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:755: undefined reference to `QgsMapCanvas::freeze(bool)'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp::dropEvent(QDropEvent*)':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:837: undefined reference to `QgsMapCanvas::freeze(bool)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:867: undefined reference to `QgsMapCanvas::freeze(bool)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:868: undefined reference to `QgsMapCanvas::refresh()'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp::showStyleManagerV2()':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1159: undefined reference to `QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog(QgsStyleV2*, QWidget*)'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp::createStatusBar()':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1595: undefined reference to `QgsScaleComboBox::QgsScaleComboBox(QWidget*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1639: undefined reference to `QgsMapCanvas::mapRenderer()'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp::setupConnections()':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1878: undefined reference to `QgsMapCanvas::mapRenderer()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1880: undefined reference to `QgsMapCanvas::mapRenderer()'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1882: undefined reference to `QgsMapCanvas::mapRenderer()'
../../../src/app/libqgis_app.a(qgisapp.cpp.o): In function `QgisApp::createCanvasTools()':
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1943: undefined reference to `QgsMapToolZoom::QgsMapToolZoom(QgsMapCanvas*, bool)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1944: undefined reference to `QgsMapTool::setAction(QAction*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1945: undefined reference to `QgsMapToolZoom::QgsMapToolZoom(QgsMapCanvas*, bool)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1946: undefined reference to `QgsMapTool::setAction(QAction*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1947: undefined reference to `QgsMapToolPan::QgsMapToolPan(QgsMapCanvas*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1948: undefined reference to `QgsMapTool::setAction(QAction*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1954: undefined reference to `QgsMapTool::setAction(QAction*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1958: undefined reference to `QgsMapTool::setAction(QAction*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1960: undefined reference to `QgsMapTool::setAction(QAction*)'
/usr/src/qgis/qgis/src/app/qgisapp.cpp:1962: undefined reference to `QgsMapTool::setAction(QAction*)'
../../../src/app/libqgis_app.a(qgisapp.cpp.o):/usr/src/qgis/qgis/src/app/qgisapp.cpp:1964: more undefined references to `QgsMapTool::setAction(QAction*)' follow

and more later..

#9 Updated by Radim Blazek over 10 years ago

Try with 0b1895463

#10 Updated by Sandro Santilli over 10 years ago

  • % Done changed from 0 to 100
  • Resolution set to fixed

Yep, that fixed it. Thanks

#11 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Closed

#12 Updated by Radim Blazek over 10 years ago

  • Status changed from Closed to Reopened

Not yet completely fixed, call to qgisCrashDump() from QgisApp is still disabled.

#13 Updated by Radim Blazek over 10 years ago

  • Resolution deleted (fixed)
  • Status changed from Reopened to Closed

Full fix by Jef in 0a1d44fc

Also available in: Atom PDF