immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.79k stars 219 forks source link

ast_exporter can't convert a c code to ast #1080

Closed hong-code closed 2 months ago

hong-code commented 2 months ago

ast_exporter be built successfully, however it can't generate ast.

the code errors : "c2rust-transpile: /home/c2rust/c2rust-ast-exporter/src/AstExporter.cpp:2793: Outputs process(int, const char*, int): Assertion `outputs.size() == 1 && "Expected exactly one output."' failed."

I using debug json : { "type": "lldb", "request": "launch", "name": "Debug executable 'c2rust-transpile'", "cargo": { "args": [ "build", "--bin=c2rust-transpile", "--package=c2rust" ], "filter": { "name": "c2rust-transpile", "kind": "bin" } }, "args": ["/home/EvilStrGen/build/compile_commands.json"], "cwd": "${workspaceFolder}"}

fw-immunant commented 2 months ago

Can you provide the contents of the compile_commands.json you're using?

hong-code commented 2 months ago

I have already solved this problem, maily due to my negligence, I use c2rust to translate c++code to rust, which is not supported by c2rust.