75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h>
Asked Answered
A

3

6

I'm a beginner in working with CGAL libraries , I tried to run a combinatorial map example qt-creator on fedora after combiling CGAL:

#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 file:

QT -= gui

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

DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += \
        main.cpp

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

but it shows the following error:

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>

I searched about the problem , but nothing is working with me I appreciate any help thanks

Afterdeck answered 15/7, 2018 at 18:22 Comment(2)
Does the file /usr/include/stdlib.h exist?Parimutuel
yes,it's existsAfterdeck
A
11

I solved it by removing INCLUDEPATH += /usr/include from .pro file

Afterdeck answered 15/7, 2018 at 18:51 Comment(1)
I have a somewhat similar issue, related to qt and G++; it is being said that it somewhat has to do with -isystem or -I, but unfortunately I don't have yet found a simple explanation, and how to resolve this. C++ is just too complex for its own good, since this include_next must come from some pre-compiled headers which then breaks (even more so if you use non-standard paths, which I do, so this ties me down in regarsd to flexibility).Tot
C
0

I got an solution: replace all #include_next with #include.

Classroom answered 15/2, 2023 at 17:36 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Mystic
R
0

You should go to the next path: "/usr/include/c++/8/bits" and here in all std files change all #include_next on just #include (use CTRL + F for search)

Rags answered 6/8 at 9:42 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Mystic

© 2022 - 2024 — McMap. All rights reserved.