eliben / pycparser

:snake: Complete C99 parser in pure Python
Other
3.21k stars 611 forks source link

Unable to invoke 'cpp'. Make sure its path was passed correctly #459

Closed kunzeng-ch closed 2 years ago

kunzeng-ch commented 2 years ago

Hello! Can you help me? I got the problem: "Unable to invoke 'cpp'. Make sure its path was passed correctly", when I ran the commond: ast = parse_file(filename, use_cpp=True)

eliben commented 2 years ago

Sorry, parse_file is just an example convenience function. It's the responsibility of the user to invoke the C preprocessor correctly and provide pycparser with preprocessed code. pycparser also has an example of using gcc -E as the preprocessor, but it really depends on what you have installed on your machine.