I try to compile a project in qt and after i link the necessary libs i ghet the fallowing linking error :
labelbox.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall LabelImage::setAxis(class Eigen::Matrix<double,4,4,0,4,4>)" (?setAxis#LabelImage##QAEXV?$Matrix#N$03$03$0A#$03$03#Eigen###Z) referenced in function "public: void __thiscall ImageView::setRotMat(class Eigen::Matrix<double,4,4,0,4,4> &)" (?setRotMat#ImageView##QAEXAAV?$Matrix#N$03$03$0A#$03$03#Eigen###Z)
If i go in the matrix.h from eigen i see the next problems :
In the fallowing lines of code :
template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Matrix
: public PlainObjectBase<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
{
public:
/** \brief Base class typedef.
* \sa PlainObjectBase
*/
typedef PlainObjectBase<Matrix> Base;
enum { Options = _Options };
EIGEN_DENSE_PUBLIC_INTERFACE(Matrix)
typedef typename Base::PlainObject PlainObject;
using Base::base;
using Base::coeffRef;
/**
* \brief Assigns matrices to each other.
*
* \note This is a special case of the templated operator=. Its purpose is
* to prevent a default operator= from hiding the templated operator=.
*
* \callgraph
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix& operator=(const Matrix& other)
{
return Base::_set(other);
}
/** \internal
* \brief Copies the value of the expression \a other into \c *this with automatic resizing.
*
* *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized),
* it will be initialized.
*
* Note that copying a row-vector into a vector (and conversely) is allowed.
* The resizing, if any, is then done in the appropriate way so that row-vectors
* remain row-vectors and vectors remain vectors.
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix& operator=(const DenseBase<OtherDerived>& other)
{
return Base::_set(other);
}
/* Here, doxygen failed to copy the brief information when using \copydoc */
/**
* \brief Copies the generic expression \a other into *this.
* \copydetails DenseBase::operator=(const EigenBase<OtherDerived> &other)
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix& operator=(const EigenBase<OtherDerived> &other)
{
return Base::operator=(other);
}
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix& operator=(const ReturnByValue<OtherDerived>& func)
{
return Base::operator=(func);
}
/** \brief Default constructor.
*
* For fixed-size matrices, does nothing.
*
* For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix
* is called a null matrix. This constructor is the unique way to create null matrices: resizing
* a matrix to 0 is not supported.
*
* \sa resize(Index,Index)
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix() : Base()
{
Base::_check_template_params();
EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
}
// FIXME is it still needed
EIGEN_DEVICE_FUNC
explicit Matrix(internal::constructor_without_unaligned_array_assert)
: Base(internal::constructor_without_unaligned_array_assert())
{ Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED }
#if EIGEN_HAS_RVALUE_REFERENCES
EIGEN_DEVICE_FUNC
Matrix(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_constructible<Scalar>::value)
: Base(std::move(other))
{
Base::_check_template_params();
if (RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic)
Base::_set_noalias(other);
}
EIGEN_DEVICE_FUNC
Matrix& operator=(Matrix&& other) EIGEN_NOEXCEPT_IF(std::is_nothrow_move_assignable<Scalar>::value)
{
other.swap(*this);
return *this;
}
#endif
#ifndef EIGEN_PARSED_BY_DOXYGEN
// This constructor is for both 1x1 matrices and dynamic vectors
template<typename T>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE explicit Matrix(const T& x)
{
Base::_check_template_params();
Base::template _init1<T>(x);
}
template<typename T0, typename T1>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix(const T0& x, const T1& y)
{
Base::_check_template_params();
Base::template _init2<T0,T1>(x, y);
}
#else
/** \brief Constructs a fixed-sized matrix initialized with coefficients starting at \a data */
EIGEN_DEVICE_FUNC
explicit Matrix(const Scalar *data);
/** \brief Constructs a vector or row-vector with given dimension. \only_for_vectors
*
* This is useful for dynamic-size vectors. For fixed-size vectors,
* it is redundant to pass these parameters, so one should use the default constructor
* Matrix() instead.
*
* \warning This constructor is disabled for fixed-size \c 1x1 matrices. For instance,
* calling Matrix<double,1,1>(1) will call the initialization constructor: Matrix(const Scalar&).
* For fixed-size \c 1x1 matrices it is therefore recommended to use the default
* constructor Matrix() instead, especially when using one of the non standard
* \c EIGEN_INITIALIZE_MATRICES_BY_{ZERO,\c NAN} macros (see \ref TopicPreprocessorDirectives).
*/
EIGEN_STRONG_INLINE explicit Matrix(Index dim);
/** \brief Constructs an initialized 1x1 matrix with the given coefficient */
Matrix(const Scalar& x);
/** \brief Constructs an uninitialized matrix with \a rows rows and \a cols columns.
*
* This is useful for dynamic-size matrices. For fixed-size matrices,
* it is redundant to pass these parameters, so one should use the default constructor
* Matrix() instead.
*
* \warning This constructor is disabled for fixed-size \c 1x2 and \c 2x1 vectors. For instance,
* calling Matrix2f(2,1) will call the initialization constructor: Matrix(const Scalar& x, const Scalar& y).
* For fixed-size \c 1x2 or \c 2x1 vectors it is therefore recommended to use the default
* constructor Matrix() instead, especially when using one of the non standard
* \c EIGEN_INITIALIZE_MATRICES_BY_{ZERO,\c NAN} macros (see \ref TopicPreprocessorDirectives).
*/
EIGEN_DEVICE_FUNC
Matrix(Index rows, Index cols);
/** \brief Constructs an initialized 2D vector with given coefficients */
Matrix(const Scalar& x, const Scalar& y);
#endif
/** \brief Constructs an initialized 3D vector with given coefficients */
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z)
{
Base::_check_template_params();
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3)
m_storage.data()[0] = x;
m_storage.data()[1] = y;
m_storage.data()[2] = z;
}
/** \brief Constructs an initialized 4D vector with given coefficients */
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w)
{
Base::_check_template_params();
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4)
m_storage.data()[0] = x;
m_storage.data()[1] = y;
m_storage.data()[2] = z;
m_storage.data()[3] = w;
}
/** \brief Copy constructor */
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix(const Matrix& other) : Base(other)
{ }
/** \brief Copy constructor for generic expressions.
* \sa MatrixBase::operator=(const EigenBase<OtherDerived>&)
*/
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Matrix(const EigenBase<OtherDerived> &other)
: Base(other.derived())
{ }
EIGEN_DEVICE_FUNC inline Index innerStride() const { return 1; }
EIGEN_DEVICE_FUNC inline Index outerStride() const { return this->innerSize(); }
/////////// Geometry module ///////////
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
explicit Matrix(const RotationBase<OtherDerived,ColsAtCompileTime>& r);
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
Matrix& operator=(const RotationBase<OtherDerived,ColsAtCompileTime>& r);
// allow to extend Matrix outside Eigen
#ifdef EIGEN_MATRIX_PLUGIN
#include EIGEN_MATRIX_PLUGIN
#endif
protected:
template <typename Derived, typename OtherDerived, bool IsVector>
friend struct internal::conservative_resize_like_impl;
using Base::m_storage;
};
/** \defgroup matrixtypedefs Global matrix typedefs
*
* \ingroup Core_Module
*
* Eigen defines several typedef shortcuts for most common matrix and vector types.
*
* The general patterns are the following:
*
* \c MatrixSizeType where \c Size can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size,
* and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd
* for complex double.
*
* For example, \c Matrix3d is a fixed-size 3x3 matrix type of doubles, and \c MatrixXf is a dynamic-size matrix of floats.
*
* There are also \c VectorSizeType and \c RowVectorSizeType which are self-explanatory. For example, \c Vector4cf is
* a fixed-size vector of 4 complex floats.
*
* \sa class Matrix
*/
#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \
/** \ingroup matrixtypedefs */ \
typedef Matrix<Type, Size, Size> Matrix##SizeSuffix##TypeSuffix; \
/** \ingroup matrixtypedefs */ \
typedef Matrix<Type, Size, 1> Vector##SizeSuffix##TypeSuffix; \
/** \ingroup matrixtypedefs */ \
typedef Matrix<Type, 1, Size> RowVector##SizeSuffix##TypeSuffix;
#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \
/** \ingroup matrixtypedefs */ \
typedef Matrix<Type, Size, Dynamic> Matrix##Size##X##TypeSuffix; \
/** \ingroup matrixtypedefs */ \
typedef Matrix<Type, Dynamic, Size> Matrix##X##Size##TypeSuffix;
#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \
EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \
EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \
EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \
EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<float>, cf)
EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES
#undef EIGEN_MAKE_TYPEDEFS
#undef EIGEN_MAKE_FIXED_TYPEDEFS
} // end namespace Eigen
#endif // EIGEN_MATRIX_H
I got the next errors :
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:18: error: use of undeclared identifier 'Matrix'
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:18: error: '_Scalar' does not refer to a value
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:18: error: explicit specialization of non-template struct 'traits'
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:179: error: unknown template name 'PlainObjectBase'
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:186: error: no template named 'PlainObjectBase'
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:190: error: expected ';' at end of declaration list
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:194: error: 'Eigen::Matrix::Base' (aka 'int') is not a class, namespace, or enumeration
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:205: error: unknown type name 'EIGEN_DEVICE_FUNC'
D:\toolchain-master\LabelingTool\Dependencies\build_dir\include\eigen3\Eigen\src\Core\Matrix.h:450: error: too few template arguments for class template 'Matrix'
................................................
I don't know if i link the library correctly , here is my .pro folder :
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QT += core gui charts
TARGET = LabelingTool
TEMPLATE = app
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
INCLUDEPATH += /usr/local/include/
LIBS += -L/usr/local/lib64 -losg -losgDB -losgGA -losgViewer -losgText
# LIBS += D:/Qt/5.11.2/msvc2015/ -llibEGL -llibGLESv2 -lQt5AccessibilitySupport -lQt5AxBase -lQt5AxContainer -lQt5AxServer -lQt5Bluetooth -lQt5Bootstrap -lQt5Charts -lQt5Concurrent
SOURCES += \
src/main.cpp \
src/MainWindow/mainwindow.cpp \
src/MainOsgViewer/mainosgviewer.cpp \
src/LabelData/labeldata.cpp \
src/LabelEventHandler/labeleventhandler.cpp \
src/ImageView/imageview.cpp \
src/InformationFormular/informationformular.cpp \
src/Polynomial/polynomial.cpp \
src/Chart/chart.cpp \
src/LabelImage/labelimage.cpp \
src/YamlReader/yamlreader.cpp \
src/LabelBox/labelbox.cpp \
src/SliderBar/sliderbar.cpp \
src/LabelData/labeldata.cpp \
HEADERS += \
src/MainWindow/mainwindow.h \
src/MainOsgViewer/mainosgviewer.h \
src/LabelData/labeldata.h \
src/LabelEventHandler/labeleventhandler.h \
src/ImageView/imageview.h \
src/InformationFormular/informationformular.h \
src/Polynomial/polynomial.h \
src/Chart/chart.h \
src/LabelImage/labelimage.h \
src/YamlReader/yamlreader.h \
src/LabelBox/labelbox.h \
src/SliderBar/sliderbar.h \
src/LabelData/labeldata.h \
Dependencies/build_dir/include/eigen3/Eigen/src/Core/Matrix.h \
DISTFILES += \
CMakeLists.txt
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -lOpenThreads \
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -lOpenThreadsd \
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -lOpenThreads \
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include \
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include \
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgAnimation
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgAnimationd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgAnimation
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgDB
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgDBd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgDB
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgFX
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgFXd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgFX
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgManipulator
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgManipulatord
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgManipulator
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgParticle
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgParticled
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgParticle
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgPresentation
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgPresentationd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgPresentation
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgShadow
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgShadowd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgShadow
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgSim
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgSimd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgSim
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTerrain
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTerraind
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTerrain
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgText
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTextd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgText
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUI
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUId
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUI
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUtil
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUtild
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUtil
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgViewer
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgViewerd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgViewer
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgVolume
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgVolumed
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgVolume
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgWidget
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgWidgetd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgWidget
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgGA
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgGAd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgGA
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
INCLUDEPATH += $$PWD/Dependencies/eigen-eigen
DEPENDPATH += $$PWD/Dependencies/eigen-eigen
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/yaml-cpp-masterr/lib/ -llibyaml-cppmd
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/yaml-cpp-masterr/lib/ -llibyaml-cppmdd
else:unix: LIBS += -L$$PWD/Dependencies/yaml-cpp-masterr/lib/ -llibyaml-cppmd
INCLUDEPATH += $$PWD/Dependencies/yaml-cpp-masterr/include
DEPENDPATH += $$PWD/Dependencies/yaml-cpp-masterr/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgd
else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Core
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Cored
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Core
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Gui
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Guid
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Gui
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svg
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svgd
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svg
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgets
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgetsd
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgets
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Script
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Scriptd
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Script
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmain
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmaind
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmain
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5QuickWidgets
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5QuickWidgetsd
else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5QuickWidgets
INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
.................................................................................
I don't use qt, so take this with a grain of salt. You have two possible issues that I see:
In the
HEADERS += \
....
Dependencies/build_dir/include/eigen3/Eigen/src/Core/Matrix.h \
I think you shoud be using Dependencies/build_dir/include/eigen3/Eigen/Core instead.
The lines:
INCLUDEPATH += $$PWD/Dependencies/eigen-eigen
DEPENDPATH += $$PWD/Dependencies/eigen-eigen
seem to have a different path than the included path in item '1' above. This may not be an issue if the two directories are identical, but if not, you'll have version mismatch issues.
I am fresh in using MongoDB c++ in Qt.
I already installed Boost, MongoDB c driver, MongoDB c++ driver and also tested DB's connection on VS2017 successfully following MongoDB tutorial(https://mongodb.github.io/mongo-cxx-driver/mongocxx-v3/tutorial/).
However, a lot of problem occurred when I wanted to apply the same code on Qt.
The overall setting:
Win10
Qt Creator v4.6.0 with
Qt v5.10.1 MSVC2017 64-bit
Microsoft Visual C++ Compiler 15.0
Debugger CDB x64
MongoDB v3.6.3
Boost 1.66.0 as lib64-msvc-14.1
Mongo c driver v1.9.3
Mongo cxx driver r3.2.0
The program just break down when initializing the instance as the following picture:
Break Down
The program also crashed when only using
$mongocxx::instance inst()
C4930 warning was produced when compiling as using
$mongocxx::instance inst( )
I guess there are two potential reason for my problem
Linking error
Wrong version of boost/mongocxx driver
Following is definition in .pro file
INCLUDEPATH += $$PWD/driver/c/include/libbson-1.0
DEPENDPATH += $$PWD/driver/c/include/libbson-1.0
LIBS += -L$$PWD/driver/c/lib -lbson-1.0
LIBS += -L$$PWD/driver/c/lib -lbson-static-1.0
INCLUDEPATH += $$PWD/driver/c/include/libmongoc-1.0
DEPENDPATH += $$PWD/driver/c/include/libmongoc-1.0
LIBS += -L$$PWD/driver/c/lib -lmongoc-1.0
LIBS += -L$$PWD/driver/c/lib -lmongoc-static-1.0
INCLUDEPATH += $$PWD/driver/c++/include/bsoncxx/v_noabi
DEPENDPATH += $$PWD/driver/c++/include/bsoncxx/v_noabi
LIBS += -L$$PWD/driver/c++/lib -lbsoncxx
INCLUDEPATH += $$PWD/driver/c++/include/mongocxx/v_noabi
DEPENDPATH += $$PWD/driver/c++/include/mongocxx/v_noabi
LIBS += -L$$PWD/driver/c++/lib -lmongocxx
INCLUDEPATH += $$PWD/driver/boost_1_66_0
DEPENDPATH += $$PWD/driver/boost_1_66_0
LIBS += -L$$PWD/driver/boost_1_66_0/lib64-msvc-14.1 \
-lboost_atomic-vc141-mt-gd-x64-1_66 \
-lboost_atomic-vc141-mt-x64-1_66 \
-lboost_bzip2-vc141-mt-gd-x64-1_66 \
-lboost_bzip2-vc141-mt-x64-1_66 \
-lboost_chrono-vc141-mt-gd-x64-1_66 \
-lboost_chrono-vc141-mt-x64-1_66 \
-lboost_container-vc141-mt-gd-x64-1_66 \
-lboost_container-vc141-mt-x64-1_66 \
-lboost_context-vc141-mt-gd-x64-1_66 \
-lboost_context-vc141-mt-x64-1_66 \
-lboost_coroutine-vc141-mt-gd-x64-1_66 \
-lboost_coroutine-vc141-mt-x64-1_66 \
-lboost_date_time-vc141-mt-gd-x64-1_66 \
-lboost_date_time-vc141-mt-x64-1_66 \
-lboost_fiber-vc141-mt-gd-x64-1_66 \
-lboost_fiber-vc141-mt-x64-1_66 \
-lboost_filesystem-vc141-mt-gd-x64-1_66 \
-lboost_filesystem-vc141-mt-x64-1_66 \
-lboost_graph-vc141-mt-gd-x64-1_66 \
-lboost_graph-vc141-mt-x64-1_66 \
-lboost_iostreams-vc141-mt-gd-x64-1_66 \
-lboost_iostreams-vc141-mt-x64-1_66 \
-lboost_locale-vc141-mt-gd-x64-1_66 \
-lboost_locale-vc141-mt-x64-1_66 \
-lboost_log-vc141-mt-gd-x64-1_66 \
-lboost_log-vc141-mt-x64-1_66 \
-lboost_log_setup-vc141-mt-gd-x64-1_66 \
-lboost_log_setup-vc141-mt-x64-1_66 \
-lboost_math_c99-vc141-mt-gd-x64-1_66 \
-lboost_math_c99-vc141-mt-x64-1_66 \
-lboost_math_c99f-vc141-mt-gd-x64-1_66 \
-lboost_math_c99f-vc141-mt-x64-1_66 \
-lboost_math_c99l-vc141-mt-gd-x64-1_66 \
-lboost_math_c99l-vc141-mt-x64-1_66 \
-lboost_math_tr1-vc141-mt-gd-x64-1_66 \
-lboost_math_tr1-vc141-mt-x64-1_66 \
-lboost_math_tr1f-vc141-mt-gd-x64-1_66 \
-lboost_math_tr1f-vc141-mt-x64-1_66 \
-lboost_math_tr1l-vc141-mt-gd-x64-1_66 \
-lboost_math_tr1l-vc141-mt-x64-1_66 \
-lboost_prg_exec_monitor-vc141-mt-gd-x64-1_66 \
-lboost_prg_exec_monitor-vc141-mt-x64-1_66 \
-lboost_program_options-vc141-mt-gd-x64-1_66 \
-lboost_program_options-vc141-mt-x64-1_66 \
-lboost_python-vc141-mt-gd-x64-1_66 \
-lboost_python-vc141-mt-x64-1_66 \
-lboost_random-vc141-mt-gd-x64-1_66 \
-lboost_random-vc141-mt-x64-1_66 \
-lboost_regex-vc141-mt-gd-x64-1_66 \
-lboost_regex-vc141-mt-x64-1_66 \
-lboost_serialization-vc141-mt-gd-x64-1_66 \
-lboost_serialization-vc141-mt-x64-1_66 \
-lboost_signals-vc141-mt-gd-x64-1_66 \
-lboost_signals-vc141-mt-x64-1_66 \
-lboost_stacktrace_noop-vc141-mt-gd-x64-1_66 \
-lboost_stacktrace_noop-vc141-mt-x64-1_66 \
-lboost_stacktrace_windbg-vc141-mt-gd-x64-1_66 \
-lboost_stacktrace_windbg-vc141-mt-x64-1_66 \
-lboost_stacktrace_windbg_cached-vc141-mt-gd-x64-1_66 \
-lboost_stacktrace_windbg_cached-vc141-mt-x64-1_66 \
-lboost_system-vc141-mt-gd-x64-1_66 \
-lboost_system-vc141-mt-x64-1_66 \
-lboost_thread-vc141-mt-gd-x64-1_66 \
-lboost_thread-vc141-mt-x64-1_66 \
-lboost_timer-vc141-mt-gd-x64-1_66 \
-lboost_timer-vc141-mt-x64-1_66 \
-lboost_type_erasure-vc141-mt-gd-x64-1_66 \
-lboost_type_erasure-vc141-mt-x64-1_66 \
-lboost_unit_test_framework-vc141-mt-gd-x64-1_66 \
-lboost_unit_test_framework-vc141-mt-x64-1_66 \
-lboost_wave-vc141-mt-gd-x64-1_66 \
-lboost_wave-vc141-mt-x64-1_66 \
-lboost_wserialization-vc141-mt-gd-x64-1_66 \
-lboost_wserialization-vc141-mt-x64-1_66 \
-lboost_zlib-vc141-mt-gd-x64-1_66 \
-lboost_zlib-vc141-mt-x64-1_66 \
-llibboost_atomic-vc141-mt-gd-x64-1_66 \
-llibboost_atomic-vc141-mt-s-x64-1_66 \
-llibboost_atomic-vc141-mt-sgd-x64-1_66 \
-llibboost_atomic-vc141-mt-x64-1_66 \
-llibboost_bzip2-vc141-mt-gd-x64-1_66 \
-llibboost_bzip2-vc141-mt-s-x64-1_66 \
-llibboost_bzip2-vc141-mt-sgd-x64-1_66 \
-llibboost_bzip2-vc141-mt-x64-1_66 \
-llibboost_chrono-vc141-mt-gd-x64-1_66 \
-llibboost_chrono-vc141-mt-s-x64-1_66 \
-llibboost_chrono-vc141-mt-sgd-x64-1_66 \
-llibboost_chrono-vc141-mt-x64-1_66 \
-llibboost_container-vc141-mt-gd-x64-1_66 \
-llibboost_container-vc141-mt-s-x64-1_66 \
-llibboost_container-vc141-mt-sgd-x64-1_66 \
-llibboost_container-vc141-mt-x64-1_66 \
-llibboost_context-vc141-mt-gd-x64-1_66 \
-llibboost_context-vc141-mt-s-x64-1_66 \
-llibboost_context-vc141-mt-sgd-x64-1_66 \
-llibboost_context-vc141-mt-x64-1_66 \
-llibboost_coroutine-vc141-mt-gd-x64-1_66 \
-llibboost_coroutine-vc141-mt-s-x64-1_66 \
-llibboost_coroutine-vc141-mt-sgd-x64-1_66 \
-llibboost_coroutine-vc141-mt-x64-1_66 \
-llibboost_date_time-vc141-mt-gd-x64-1_66 \
-llibboost_date_time-vc141-mt-s-x64-1_66 \
-llibboost_date_time-vc141-mt-sgd-x64-1_66 \
-llibboost_date_time-vc141-mt-x64-1_66 \
-llibboost_exception-vc141-mt-gd-x64-1_66 \
-llibboost_exception-vc141-mt-s-x64-1_66 \
-llibboost_exception-vc141-mt-sgd-x64-1_66 \
-llibboost_exception-vc141-mt-x64-1_66 \
-llibboost_fiber-vc141-mt-gd-x64-1_66 \
-llibboost_fiber-vc141-mt-s-x64-1_66 \
-llibboost_fiber-vc141-mt-sgd-x64-1_66 \
-llibboost_fiber-vc141-mt-x64-1_66 \
-llibboost_filesystem-vc141-mt-gd-x64-1_66 \
-llibboost_filesystem-vc141-mt-s-x64-1_66 \
-llibboost_filesystem-vc141-mt-sgd-x64-1_66 \
-llibboost_filesystem-vc141-mt-x64-1_66 \
-llibboost_graph-vc141-mt-gd-x64-1_66 \
-llibboost_graph-vc141-mt-s-x64-1_66 \
-llibboost_graph-vc141-mt-sgd-x64-1_66 \
-llibboost_graph-vc141-mt-x64-1_66 \
-llibboost_iostreams-vc141-mt-gd-x64-1_66 \
-llibboost_iostreams-vc141-mt-s-x64-1_66 \
-llibboost_iostreams-vc141-mt-sgd-x64-1_66 \
-llibboost_iostreams-vc141-mt-x64-1_66 \
-llibboost_locale-vc141-mt-gd-x64-1_66 \
-llibboost_locale-vc141-mt-s-x64-1_66 \
-llibboost_locale-vc141-mt-sgd-x64-1_66 \
-llibboost_locale-vc141-mt-x64-1_66 \
-llibboost_log-vc141-mt-gd-x64-1_66 \
-llibboost_log-vc141-mt-s-x64-1_66 \
-llibboost_log-vc141-mt-sgd-x64-1_66 \
-llibboost_log-vc141-mt-x64-1_66 \
-llibboost_log_setup-vc141-mt-gd-x64-1_66 \
-llibboost_log_setup-vc141-mt-s-x64-1_66 \
-llibboost_log_setup-vc141-mt-sgd-x64-1_66 \
-llibboost_log_setup-vc141-mt-x64-1_66 \
-llibboost_math_c99-vc141-mt-gd-x64-1_66 \
-llibboost_math_c99-vc141-mt-s-x64-1_66 \
-llibboost_math_c99-vc141-mt-sgd-x64-1_66 \
-llibboost_math_c99-vc141-mt-x64-1_66 \
-llibboost_math_c99f-vc141-mt-gd-x64-1_66 \
-llibboost_math_c99f-vc141-mt-s-x64-1_66 \
-llibboost_math_c99f-vc141-mt-sgd-x64-1_66 \
-llibboost_math_c99f-vc141-mt-x64-1_66 \
-llibboost_math_c99l-vc141-mt-gd-x64-1_66 \
-llibboost_math_c99l-vc141-mt-s-x64-1_66 \
-llibboost_math_c99l-vc141-mt-sgd-x64-1_66 \
-llibboost_math_c99l-vc141-mt-x64-1_66 \
-llibboost_math_tr1-vc141-mt-gd-x64-1_66 \
-llibboost_math_tr1-vc141-mt-s-x64-1_66 \
-llibboost_math_tr1-vc141-mt-sgd-x64-1_66 \
-llibboost_math_tr1-vc141-mt-x64-1_66 \
-llibboost_math_tr1f-vc141-mt-gd-x64-1_66 \
-llibboost_math_tr1f-vc141-mt-s-x64-1_66 \
-llibboost_math_tr1f-vc141-mt-sgd-x64-1_66 \
-llibboost_math_tr1f-vc141-mt-x64-1_66 \
-llibboost_math_tr1l-vc141-mt-gd-x64-1_66 \
-llibboost_math_tr1l-vc141-mt-s-x64-1_66 \
-llibboost_math_tr1l-vc141-mt-sgd-x64-1_66 \
-llibboost_math_tr1l-vc141-mt-x64-1_66 \
-llibboost_prg_exec_monitor-vc141-mt-gd-x64-1_66 \
-llibboost_prg_exec_monitor-vc141-mt-s-x64-1_66 \
-llibboost_prg_exec_monitor-vc141-mt-sgd-x64-1_66 \
-llibboost_prg_exec_monitor-vc141-mt-x64-1_66 \
-llibboost_program_options-vc141-mt-gd-x64-1_66 \
-llibboost_program_options-vc141-mt-s-x64-1_66 \
-llibboost_program_options-vc141-mt-sgd-x64-1_66 \
-llibboost_program_options-vc141-mt-x64-1_66 \
-llibboost_python-vc141-mt-gd-x64-1_66 \
-llibboost_python-vc141-mt-s-x64-1_66 \
-llibboost_python-vc141-mt-sgd-x64-1_66 \
-llibboost_python-vc141-mt-x64-1_66 \
-llibboost_random-vc141-mt-gd-x64-1_66 \
-llibboost_random-vc141-mt-s-x64-1_66 \
-llibboost_random-vc141-mt-sgd-x64-1_66 \
-llibboost_random-vc141-mt-x64-1_66 \
-llibboost_regex-vc141-mt-gd-x64-1_66 \
-llibboost_regex-vc141-mt-s-x64-1_66 \
-llibboost_regex-vc141-mt-sgd-x64-1_66 \
-llibboost_regex-vc141-mt-x64-1_66 \
-llibboost_serialization-vc141-mt-gd-x64-1_66 \
-llibboost_serialization-vc141-mt-s-x64-1_66 \
-llibboost_serialization-vc141-mt-sgd-x64-1_66 \
-llibboost_serialization-vc141-mt-x64-1_66 \
-llibboost_signals-vc141-mt-gd-x64-1_66 \
-llibboost_signals-vc141-mt-s-x64-1_66 \
-llibboost_signals-vc141-mt-sgd-x64-1_66 \
-llibboost_signals-vc141-mt-x64-1_66 \
-llibboost_stacktrace_noop-vc141-mt-gd-x64-1_66 \
-llibboost_stacktrace_noop-vc141-mt-s-x64-1_66 \
-llibboost_stacktrace_noop-vc141-mt-sgd-x64-1_66 \
-llibboost_stacktrace_noop-vc141-mt-x64-1_66 \
-llibboost_stacktrace_windbg-vc141-mt-gd-x64-1_66 \
-llibboost_stacktrace_windbg-vc141-mt-s-x64-1_66 \
-llibboost_stacktrace_windbg-vc141-mt-sgd-x64-1_66 \
-llibboost_stacktrace_windbg-vc141-mt-x64-1_66 \
-llibboost_stacktrace_windbg_cached-vc141-mt-gd-x64-1_66 \
-llibboost_stacktrace_windbg_cached-vc141-mt-s-x64-1_66 \
-llibboost_stacktrace_windbg_cached-vc141-mt-sgd-x64-1_66 \
-llibboost_stacktrace_windbg_cached-vc141-mt-x64-1_66 \
-llibboost_system-vc141-mt-gd-x64-1_66 \
-llibboost_system-vc141-mt-s-x64-1_66 \
-llibboost_system-vc141-mt-sgd-x64-1_66 \
-llibboost_system-vc141-mt-x64-1_66 \
-llibboost_test_exec_monitor-vc141-mt-gd-x64-1_66 \
-llibboost_test_exec_monitor-vc141-mt-s-x64-1_66 \
-llibboost_test_exec_monitor-vc141-mt-sgd-x64-1_66 \
-llibboost_test_exec_monitor-vc141-mt-x64-1_66 \
-llibboost_thread-vc141-mt-gd-x64-1_66 \
-llibboost_thread-vc141-mt-s-x64-1_66 \
-llibboost_thread-vc141-mt-sgd-x64-1_66 \
-llibboost_thread-vc141-mt-x64-1_66 \
-llibboost_timer-vc141-mt-gd-x64-1_66 \
-llibboost_timer-vc141-mt-s-x64-1_66 \
-llibboost_timer-vc141-mt-sgd-x64-1_66 \
-llibboost_timer-vc141-mt-x64-1_66 \
-llibboost_type_erasure-vc141-mt-gd-x64-1_66 \
-llibboost_type_erasure-vc141-mt-s-x64-1_66 \
-llibboost_type_erasure-vc141-mt-sgd-x64-1_66 \
-llibboost_type_erasure-vc141-mt-x64-1_66 \
-llibboost_unit_test_framework-vc141-mt-gd-x64-1_66 \
-llibboost_unit_test_framework-vc141-mt-s-x64-1_66 \
-llibboost_unit_test_framework-vc141-mt-sgd-x64-1_66 \
-llibboost_unit_test_framework-vc141-mt-x64-1_66 \
-llibboost_wave-vc141-mt-gd-x64-1_66 \
-llibboost_wave-vc141-mt-s-x64-1_66 \
-llibboost_wave-vc141-mt-sgd-x64-1_66 \
-llibboost_wave-vc141-mt-x64-1_66 \
-llibboost_wserialization-vc141-mt-gd-x64-1_66 \
-llibboost_wserialization-vc141-mt-s-x64-1_66 \
-llibboost_wserialization-vc141-mt-sgd-x64-1_66 \
-llibboost_wserialization-vc141-mt-x64-1_66 \
-llibboost_zlib-vc141-mt-gd-x64-1_66 \
-llibboost_zlib-vc141-mt-s-x64-1_66 \
-llibboost_zlib-vc141-mt-sgd-x64-1_66 \
-llibboost_zlib-vc141-mt-x64-1_66
Is there any mistake in linking driver?
Or the version of driver I used is not correct (But it is normal using VS2017)
Does anyone encounter same problem?
TKS
I replied to you on the mongodb mailing list, but many of the things you are doing here are incorrect. You shouldn't be linking both the static and dynamic versions of the libraries. You shouldn't be linking both the retail and debug versions of the boost libraries, etc. You should ensure that you are linking consistent versions of the boost, QT, and mongocxx/bsoncxx/libmongoc/libbson libraries w.r.t. debug/release, static/dynamic, etc.
I recommend starting from first principles and building up incrementally with things as needed. Take one of the examples from the mongocxx project, and set up a project that succesfully builds it against the driver you have built. Then add QT support.
I have a problem when I use Qt with MATLAB mixed programming. I tested an example but it failed. Here is my code.
First is my pro file:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = paintertest
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
test1.cpp
HEADERS += mainwindow.h \
test1.h \
mat.h \
matrix.h \
mclbase.h \
mclcppclass.h \
mclmcr.h \
mclmcrrt.h \
tmwtypes.h \
MyAdde.h \
engine.h
FORMS += mainwindow.ui
INCLUDEPATH += D:/program/engineering/armadillo-8.200.2/include
INCLUDEPATH += D:/program/engineering/sigpack
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -lblas_win32_MT
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -lblas_win32_MTd
else:unix: LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -lblas_win32_MT
INCLUDEPATH += $$PWD/libBLAS_LAPACKwin32
DEPENDPATH += $$PWD/libBLAS_LAPACKwin32
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -llapack_win32_MT
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -llapack_win32_MTd
else:unix: LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -llapack_win32_MT
INCLUDEPATH += $$PWD/libBLAS_LAPACKwin32
DEPENDPATH += $$PWD/libBLAS_LAPACKwin32
unix|win32: LIBS += -L$$PWD/libBLAS_LAPACKwin32/ -lliblapacke
INCLUDEPATH += $$PWD/libBLAS_LAPACKwin32
DEPENDPATH += $$PWD/libBLAS_LAPACKwin32
INCLUDEPATH += D:/program/engineering/matlabR2014a/extern/include
INCLUDEPATH += D:/program/engineering/matlabR2014a/extern/include/win32
LIBS +=-LD:/program/engineering/matlabR2014a/extern/lib/win32/microsoft -llibmx
LIBS +=-LD:/program/engineering/matlabR2014a/extern/lib/win32/microsoft -llibmat
LIBS +=-LD:/program/engineering/matlabR2014a/extern/lib/win32/microsoft -llibmex
LIBS +=-LD:/program/engineering/matlabR2014a/extern/lib/win32/microsoft -lmclmcr
LIBS +=-LD:/program/engineering/matlabR2014a/extern/lib/win32/microsoft -lmclmcrrt
LIBS +=-LD:/program/engineering/matlabR2014a/extern/lib/win32/microsoft -llibeng
#INCLUDEPATH += C:/Users/Administrator/Desktop/Qt/paintertest
#LIBS += -LC:/Users/Administrator/Desktop/Qt/paintertest -lMyAdde
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/./ -lMyAdde
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/./ -lMyAdde
else:unix: LIBS += -L$$PWD/./ -lMyAdde
INCLUDEPATH += $$PWD/.
DEPENDPATH += $$PWD/.
And next is my mainwindow.h:
#include <QMainWindow>
#include <QPainter>
#include "test1.h"
#include <QVariant>
#include <armadillo>
#include <iostream>
#include "sigpack.h"
#include "MyAdde.h"
#include "mat.h"
#include "matrix.h"
#include "mclbase.h"
#include "mclcppclass.h"
#include "mclmcr.h"
#include "mclmcrrt.h"
#include "tmwtypes.h"
#include "engine.h"
And next is my mainwindow.cpp:
double a=6;
double b = 9;
double c;
if(MyAddeInitialize()){
qDebug()<<"ok";
}
mwArray mwA(1, 1, mxDOUBLE_CLASS);
mwArray mwB(1, 1, mxDOUBLE_CLASS);
mwArray mwC(1, 1, mxDOUBLE_CLASS);
mwA.SetData(&a, 1);
mwB.SetData(&b, 1);
MyAdde(1, mwC, mwA, mwB);
c = mwC.Get(1, 1);
cout<<"c"<<c;
MyAddeTerminate();
mclTerminateApplication();
The MyAdde.h/MyAdde.dll/MyAdde.lib is my Matlab code. Here is my Matlab code:
function [ c ] = MyAdde( a, b )
c = a+b;
end
I use MATLAB to generate MyAdde.h/MyAdde.dll/MyAdde.lib and I add this file to my Qt pro file.But some error happened.This is my Qt error:
C:\Users\Administrator\Desktop\Qt\paintertest\mainwindow.cpp:23: error: undefined reference to `MyAdde(int, mwArray&, mwArray const&, mwArray const&)'
I checked the MyAdde.h and I found this code:
extern LIB_MyAdde_CPP_API void MW_CALL_CONV MyAdde(int nargout, mwArray& c, const mwArray& a, const mwArray& b);
I thinked of that the question is caused by const mwArray& and mwArray const&. I can't understand the reason. I need your help!
It's a linker error , so it has compiled fine but the link failed
It's probably this stuff that is wrong
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/./ -lMyAdde
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/./ -lMyAdde
else:unix: LIBS += -L$$PWD/./ -lMyAdde
What are you trying to achieve ? first and second lines should normally not be the same if you have a debug and release version of you MyAdde dll
I want to use root cern libs in my Qt program. But I have problems with linker:
undefined reference to `TVersionCheck::TVersionCheck(int)
I don't know what's the reason. I did read another forum, but still can't understand the issue. Please, help me.
The .pro file contents:
QT += core
QT -= gui
CONFIG += c++11
TARGET = v_root_trees_2
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += "C:/root_v5.34.34/include"
LIBS += -L"C:/root_v5.34.34/lib" \
-lcomplexDict \
-ldequeDict \
-lfreetype \
-llibAfterImage \
-llibASImage \
-llibASImageGui \
-llibCint \
-llibCintex \
-llibCore \
-llibEG \
-llibEGPythia8 \
-llibEve \
-llibFitPanel \
-llibFoam \
-llibFTGL \
-llibFumili \
-llibGdml \
-llibGed \
-llibGenetic \
-llibGenVector \
-llibGeom \
-llibGeomBuilder \
-llibGeomPainter \
-llibGLEW \
-llibGpad \
-llibGraf \
-llibGraf3d \
-llibGui \
-llibGuiBld \
-llibGuiHtml \
-llibGviz3d \
-llibHist \
-llibHistPainter \
-llibHtml \
-llibMathCore \
-llibMathMore \
-llibMatrix \
-llibMinuit \
-llibMinuit2 \
-llibMLP \
-llibNet \
-llibPhysics \
-llibPostscript \
-llibProof \
-llibProofDraw \
-llibProofPlayer \
-llibPyROOT \
-llibQuadp \
-llibRecorder \
-llibReflex \
-llibReflexDict \
-llibRGL \
-llibRHTTP \
-llibRint \
-llibRIO \
-llibRODBC \
-llibRooFit \
-llibRooFitCore \
-llibRooStats \
-llibRootAuth \
-llibSessionViewer \
-llibSmatrix \
-llibSpectrum \
-llibSpectrumPainter \
-llibSPlot \
-llibSQLIO \
-llibTable \
-llibThread \
-llibTMVA \
-llibTree \
-llibTreePlayer \
-llibTreeViewer \
-llibUnuran \
-llibVMC \
-llibWin32gdk \
-llibXMLIO \
-llistDict \
-lmap2Dict \
-lmapDict \
-lmathtext \
-lmultimap2Dict \
-lmultimapDict \
-lmultisetDict \
-lsetDict \
-lvectorDict
main.cpp file:
#include <QCoreApplication>
#include "TMultiGraph.h" // problem if add this line
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
return a.exec();
}
I don't know what is wrong. I added all .lib files.
The paths C:/root_v5.34.34/lib and C:/root_v5.34.34/include are correct and do exist. Changing paths I see cannot find ... error.
So, the paths are correct.
I checked the similar code in VS2013 and don't see any errors.
But I write a lot of code in Qt and can't change IDE.
I understand, that some link causes the error, but can't find it.
Some libraries in your project are included incorrectly. e.g. -llibAfterImage -llibASImage -llibASImageGui
you should write -lAfterImage -lASImage -lASImageGui and so on...
When i corrected your .pro file, build succeeded.
Possibly one of that incorrectly included libraries contains implementation of TVersionCheck::TVersionCheck(int)
I was struggling for this problem recently. It's because that ROOT under windows is 32bit, and you need to check the MSCV2015 32bit while reinstalling Qt...