【问题标题】:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h>75:15:致命错误:stdlib.h:没有这样的文件或目录#include_next <stdlib.h>
【发布时间】:2018-12-23 08:41:38
【问题描述】:

我是使用 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>

我搜索了这个问题,但没有什么对我有用 我很感激任何帮助 谢谢

【问题讨论】:

  • 文件/usr/include/stdlib.h是否存在?
  • 是的,它存在

标签: c++ qt-creator fedora cgal


【解决方案1】:

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

【讨论】:

  • 我有一个类似的问题,与 qt 和 G++ 相关;据说它与 -isystem 或 -I 有一些关系,但不幸的是我还没有找到一个简单的解释,以及如何解决这个问题。 C++ 本身就太复杂了,因为这个 include_next 必须来自一些预编译的头文件,然后这些头文件会中断(如果你使用非标准路径更是如此,我这样做了,所以这将我与灵活性联系在一起) .
猜你喜欢
  • 2019-03-03
  • 1970-01-01
  • 2011-10-17
  • 1970-01-01
  • 2022-09-28
  • 1970-01-01
  • 2017-05-09
  • 2021-05-15
  • 2014-10-31
相关资源
最近更新 更多