undefined reference to duckx::Document::Document
-
I'm trying to add a library to a project. https://github.com/AlexanderVatov/DuckX. Using qmake.
I encountered the following errors when executing the test code proposed by the author of the library:
.pro file looks like this:

To solve the problem, I tried to rebuild the project.
Text .pro:
QT -= gui
CONFIG += c++11 console
CONFIG -= app_bundleSOURCES +=
main.cppqnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetwin32:CONFIG(release, debug|release): LIBS += -L$$PWD/duckx/lib/ -lduckx
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/duckx/lib/ -lduckxd
else:unix: LIBS += -L$$PWD/duckx/lib/ -lduckxINCLUDEPATH += $$PWD/duckx/include/duckx
DEPENDPATH += $$PWD/duckx/include/duckxINCLUDEPATH += $$PWD/duckx/include/duckx
HEADERS +=
constants.hpp
duckx.hpp
duckxiterator.hpp
pugiconfig.hpp
pugixml.hpp
zip.h -
-
@Toruha said in undefined reference to duckx::Document::Document:
c++11 console
This doesn't tell me much, really!
Did you use the Microsoft compiler (same as in Visual Studio)? Or did you use MinGW? -
@Toruha said in undefined reference to duckx::Document::Document:
c++11 console
This doesn't tell me much, really!
Did you use the Microsoft compiler (same as in Visual Studio)? Or did you use MinGW? -
@Toruha You can't mix different compilers like in this case Microsoft compiler and MinGW. You have to build both, the library and your app, with same compiler.
But from your screen-shot above it rather looks like you're using Microsoft compiler...
-
Right, the _ITERATOR_DEBUG_LEVEL, RuntimeLibrary issues above rather show that you've done a Release build of duckx, but want to use it in a debug build of your app. This won't work; you need to compile both in the same configuration.
-
@Toruha You can't mix different compilers like in this case Microsoft compiler and MinGW. You have to build both, the library and your app, with same compiler.
But from your screen-shot above it rather looks like you're using Microsoft compiler...
-
@Toruha You can't mix different compilers like in this case Microsoft compiler and MinGW. You have to build both, the library and your app, with same compiler.
But from your screen-shot above it rather looks like you're using Microsoft compiler...
-
Right, the _ITERATOR_DEBUG_LEVEL, RuntimeLibrary issues above rather show that you've done a Release build of duckx, but want to use it in a debug build of your app. This won't work; you need to compile both in the same configuration.
