gpt4 book ai didi

c++ - 75 :15: fatal error: stdlib. h : No such file or directory #include_next

转载 作者:太空狗 更新时间:2023-10-29 20:51:11 26 4
gpt4 key购买 nike

我是使用 CGAL 库的初学者,在组合 CGAL 后,我尝试在 fedora 上运行一个组合映射示例 qt-creator:

#include <QCoreApplication>

#include <CGAL/Combinatorial_map.h>
#include <iostream>
#include <cstdlib>

typedef CGAL::Combinatorial_map<3> CMap_3;
typedef CMap_3::Dart_const_handle Dart_const_handle;

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
CMap_3 cm;
// Create two tetrahedra.
Dart_const_handle dh1 = cm.make_combinatorial_tetrahedron();
Dart_const_handle dh2 = cm.make_combinatorial_tetrahedron();
// Display the combinatorial map characteristics.
cm.display_characteristics(std::cout);
std::cout<<", valid="<<cm.is_valid()<<std::endl;
unsigned int res = 0;
// Iterate over all the darts of the first tetrahedron.
// Note that CMap_3::Dart_of_orbit_range<1,2> in 3D is equivalent to
// CMap_3::Dart_of_cell_range<3>.
for (CMap_3::Dart_of_orbit_range<1,2>::const_iterator
it(cm.darts_of_orbit<1,2>(dh1).begin()),
itend(cm.darts_of_orbit<1,2>(dh1).end()); it!=itend; ++it)
++res;
std::cout<<"Number of darts of the first tetrahedron: "<<res<<std::endl;
res = 0;
// Iterate over all the darts of the facet containing dh2.
for (CMap_3::Dart_of_orbit_range<1>::const_iterator
it(cm.darts_of_orbit<1>(dh2).begin()),
itend(cm.darts_of_orbit<1>(dh2).end()); it!=itend; ++it)
++res;
std::cout<<"Number of darts of the facet containing dh2: "<<res<<std::endl;

return a.exec();
}

.pro 文件:

QT -= gui

CONFIG += c++11 console
CONFIG -= app_bundle

DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += \
main.cpp

INCLUDEPATH += /usr/include
LIBS += -lgmp -lmpfr -lCGAL

但它显示以下错误:

In file included from /usr/include/c++/7/bits/stl_algo.h:59:0,
from /usr/include/c++/7/algorithm:62,
from /usr/include/QtCore/qglobal.h:68,
from /usr/include/qt5/QtCore/qcoreapplication.h:43,
from /usr/include/qt5/QtCore/QCoreApplication:1,
from ../untitled/main.cpp:1:
/usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>

我搜索了这个问题,但没有解决我的问题我感谢任何帮助谢谢

最佳答案

我通过从 .pro 文件中删除 INCLUDEPATH +=/usr/include 解决了这个问题

关于c++ - 75 :15: fatal error: stdlib. h : No such file or directory #include_next <stdlib. h>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51350998/

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