gpt4 book ai didi

c++ - 将 CGAL 和 BOOSt 链接到 qt-creator 项目

转载 作者:行者123 更新时间:2023-11-30 05:02:55 27 4
gpt4 key购买 nike

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

我在 BOOST 和 QT header 中遇到很多错误,这些 header 已经在它们的包中,而不是在我的代码中 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

感谢任何帮助,谢谢

*更新

最佳答案

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

关于c++ - 将 CGAL 和 BOOSt 链接到 qt-creator 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49611609/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com