Skip to content

fatal error: 'stdlib.h' file not found #1521

Closed

Description

Input C/C++ Header

#include "iostream"
#include "string"
#include <ctype.h>
#include <tuple>
#include <vector>

enum State{find=0,content=1,element=2,prop=3};
enum Type{open,close,fail};
class Property{
	public:
	std::string str;
	std::string asstr(){
		return this->str;
	}
	
};
class Style{

};

class Element{
	private:
	
	std::string element;
	
	
	
	
	public:
	Property * prop=nullptr;
	std::vector<Element *> child;
	Element * parent=nullptr;
	std::string content;
	std::string contentHTML;
	bool closed = false;
	Element(std::string elname ,Element * parentEl){
		element = elname;
		parent = parentEl;
		prop = new Property();
		//parentEl->child.push_back(this);
	}
	Element(std::string elname){
		element = elname;
	}
	void setParent(Element * parentEl){
		parent = parentEl;
	}
	std::string getTag(){
		return element;
	}
	std::string getParentTag(){
		if(parent==nullptr)
			return"";
		return parent->getTag();
	}
	void setContent(std::string s){
		content = s;
	}
};

void console_view(Element * root);
void parse(std::string page);

Bindgen Invocation

$ bindgen input.hpp

Actual Results

/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/cstdlib:75:15: fatal error: 'stdlib.h' file not found
/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/cstdlib:75:15: fatal error: 'stdlib.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', libcore/result.rs:1009:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
   9: std::panicking::try::do_call
  10: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  11: bindgen::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  16: main
  17: __libc_start_main
  18: _start

Expected Results

Everything is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions