Code driven compilation - fetching unresolved symbols from code

60 Views Asked by At

I try to write simple application that helps C/C++ code development; it looks for missing objects/functions and automatically includes one of standard C/C++ headers. I assume there're no external libs, so no name collision is possible.

First approach I thought about is to run compilation process ( gcc / clang ) from another C code and fetch missing symbols. If it's stupid, tell me. So: how can I fetch a list of unresolved symbols without hard-coded gcc output parsing?

If for one of these compiler is a lib that helps code-driven compilation, please write.

Thanks! :) Adam

1

There are 1 best solutions below

0
On

The comprehensive talk with GCC geeks lead me to https://developer.mozilla.org/en-US/docs/Dehydra/Using_Dehydra

Problably there's no easier way to do it. The best idea is to include all the headers (GCC will remove unused) or just parse the output, cause probably Dehydra can't do everything I would like it to do.