链接CGAL& BOOSt到qt-creator项目

时间:2018-04-02 12:47:30

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

我试图在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

我感谢任何帮助,谢谢

*更新

1 个答案:

答案 0 :(得分:1)

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