我有一个非常简单的 eclipse C++ 项目,包含以下三个文件:
头文件.h
#ifndef HEADER_H_
#define HEADER_H_
#include <cstdint>
#include <cinttypes>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
void func1();
#endif
源文件
#include "header.h"
void func1() {
}
主文件
#include "header.h"
int main(int argc, char** argv) {
return 0;
}
当我尝试编译项目时,编译进行但它说:
make all
Building file: ../main.cc
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cc"
In file included from ../main.cc:8:
../header.h:11:19: warning: cstdint: No such file or directory
../header.h:12:21: warning: cinttypes: No such file or directory
Finished building: ../main.cc
Building file: ../src.cc
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src.d" -MT"src.d" -o "src.o" "../src.cc"
In file included from ../src.cc:8:
../header.h:11:19: warning: cstdint: No such file or directory
../header.h:12:21: warning: cinttypes: No such file or directory
Finished building: ../src.cc
Building target: Test
Invoking: Cross G++ Linker
g++ -o "Test" ./main.o ./src.o
Finished building target: Test
即它找不到标题 cstdint 和 cinttypes,有什么我可以检查以了解为什么找不到它们吗?