【问题标题】:Linking CGAL & BOOSt to qt-creator project将 CGAL 和 BOOSt 链接到 qt-creator 项目
【发布时间】:2018-04-02 12:47:29
【问题描述】:

我正在尝试在 QT-Creator 项目中使用 CGAL 和 BOOST 库

我在 BOOST、QT 标头中遇到了许多错误,这些错误已经在他们的包中而不是我的代码 pic 大多数关于 BOOST::GET 和“point_3”类中的“正常”方法的错误............

================================================ ===================================

编译输出:

    .dr_projmy_polyhedron.cpp(201) : error C2039: 'vertex_index_map' : is not a member of 'CGAL'
..dr_projmy_polyhedron.cpp(201) : error C2780: 'boost::property_traits<boost::property_map<Config::graph_type,Property,void>::const_type>::reference boost::get(Property,const boost::adj_list_helper<Config,Base> &,const Key &)' : expects 3 arguments - 2 provided
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(1754) : see declaration of 'boost::get'
..dr_projmy_polyhedron.cpp(201) : error C2780: 'boost::property_traits<boost::property_map<Config::graph_type,Property,void>::type>::reference boost::get(Property,boost::adj_list_helper<Config,Base> &,const Key &)' : expects 3 arguments - 2 provided
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(1744) : see declaration of 'boost::get'
..dr_projmy_polyhedron.cpp(201) : error C2784: 'boost::property_map<Config::graph_type,Property,void>::const_type boost::get(Property,const boost::adj_list_helper<Config,Base> &)' : could not deduce template argument for 'const boost::adj_list_helper<Config,Base> &' from 'Surface'
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(1733) : see declaration of 'boost::get'
..dr_projmy_polyhedron.cpp(201) : error C2784: 'boost::property_map<Config::graph_type,Property,void>::type boost::get(Property,boost::adj_list_helper<Config,Base> &)' : could not deduce template argument for 'boost::adj_list_helper<Config,Base> &' from 'Surface'
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(1725) : see declaration of 'boost::get'
..dr_projmy_polyhedron.cpp(201) : error C2784: 'const property_value<Property,Tag>::type &boost::get(Tag,const boost::detail::stored_ra_edge_iter<Vertex,EdgeVec,Property> &)' : could not deduce template argument for 'const boost::detail::stored_ra_edge_iter<Vertex,EdgeVec,Property> &' from 'Surface'
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(394) : see declaration of 'boost::get'
..dr_projmy_polyhedron.cpp(201) : error C2784: 'const property_value<Property,Tag>::type &boost::get(Tag,const boost::detail::stored_edge_iter<Vertex,Iter,Property> &)' : could not deduce template argument for 'const boost::detail::stored_edge_iter<Vertex,Iter,Property> &' from 'Surface'
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(386) : see declaration of 'boost::get'
..dr_projmy_polyhedron.cpp(201) : error C2784: 'const property_value<Property,Tag>::type &boost::get(Tag,const boost::detail::stored_edge_property<Vertex,Property> &)' : could not deduce template argument for 'const boost::detail::stored_edge_property<Vertex,Property> &' from 'Surface'
C:localboost_1_59_0boost/graph/detail/adjacency_list.hpp(378) : see declaration of 'boost::get' 

see more

.pro 文件

QT       += core gui
QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000


greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = dr_proj
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as 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


SOURCES += main.cpp\
        mainwindow.cpp \
    my_polyhedron.cpp \
    myqglwidget.cpp

HEADERS  += mainwindow.h \
    My_CGAL_Config.h \
    My_Face_base.h \
    My_Halfedge_base.h \
    my_polyhedron.h \
    My_Vertex_base.h \
    myqglwidget.h

FORMS    += mainwindow.ui
INCLUDEPATH += .
INCLUDEPATH += C:/dev/CGAL-4.9/auxiliary/gmp/include
INCLUDEPATH += C:/dev/CGAL-4.9/include
INCLUDEPATH += C:/local/boost_1_59_0 -lboost_filesystem
INCLUDEPATH += C:/dev/libQGLViewer-2.7.1/QGLViewer
INCLUDEPATH += C:/dev/CGAL-4.9/build/include
INCLUDEPATH +=C:/Qt/Qt5.7.1/5.7/msvc2013_64/include
INCLUDEPATH +=C:\Qt\Qt5.7.1\5.7\msvc2013_64\include\QtXml
INCLUDEPATH +=C:\Qt\Qt5.7.1\5.7\msvc2013_64\include\QtOpenGL


LIBS += -LC:/dev/CGAL-4.9/lib
LIBS += -LC:/local/boost_1_59_0/lib
LIBS += -LC:/dev/libQGLViewer-2.7.1/QGLViewer -lQGLViewerd2
LIBS += -LC:/Qt/Qt5.7.1/5.7/msvc2013_64/lib
LIBS += -LC:\local\boost_1_59_0\lib64-msvc-12.0
        -libboost_system-vc120-mt-1_59
        -libboost_thread-vc120-mt-1_59

DEPENDPATH += C:/dev/libQGLViewer-2.7.1/QGLViewer
DEPENDPATH += C:/local/boost_1_59_0/lib
DEPENDPATH += C:/dev/CGAL-4.9/lib
DEPENDPATH +=C:/Qt/Qt5.7.1/5.7/msvc2013_64/lib
DEPENDPATH +=C:\local\boost_1_59_0\lib64-msvc-12.0

感谢任何帮助,谢谢

*更新

【问题讨论】:

    标签: c++ qt boost qt-creator cgal


    【解决方案1】:

    Q_FOREACH 的问题是由于 Qt 定义了一个名为 foreach 的宏:这已在 Boost 1.60(2015 年 12 月)中解决,我建议您升级您的 Boost 安装。此外,Qt 文档解释了如何prevent the macro from being defined

    【讨论】:

    • 我正在使用 boost 1.59,因为据我所知,此版本与 (vs 2013 , cgal 4.9) 兼容
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-26
    • 1970-01-01
    • 2018-08-19
    • 1970-01-01
    • 2012-02-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多