Я пытался запустить автономный инструмент (ASTFrontend - двоичный файл), который я построил на следующем коде c ++ (tou.cpp). Этот инструмент будет определять местоположение всех функций.
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout<<"Hello,world!";
return 0;
}
Я выполнил следующую команду
./ASTFrontend ../../sampleCode/tou.cpp
и я получил следующую ошибку:
Could not auto-detect compilation database for file "../../sampleCode/tou.cpp"
No compilation database found in /home/parallels/PierceProject/ASTParser/build/../../sampleCode or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
In file included from /home/parallels/PierceProject/ASTParser/build/../../sampleCode/tou.cpp:1:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/iostream:39:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/ostream:38:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/ios:38:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/iosfwd:40:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/postypes.h:40:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/cwchar:44:
/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
^~~~~~~~~~
1 error generated.
Я читал о других связанных вопросах, но ни один из них не помог.
В идеале выход должен выглядеть так:
#include <iostream>
#include <string>
using namespace std;
// Found function main returning int
int main()
{
cout<<"Hello,world!";
return 0;
}