在Visual Studio中引用头文件报错?-灵析社区

半寸时光爱思考

在Visual studio中新建了两个c++源文件和一个头文件,分别是main.cpp #define _CRT_SECURE_NO_WARNINGS 1 #include #include "Log.h" int main() { InitLog(); Log("Hello World!"); std::cin.get(); } Log.cpp #define _CRT_SECURE_NO_WARNINGS 1 #include void InitLog() { Log("Initializing Log"); } void Log(const char* message) { std::cout << message << std::endl; } Log.h #pragma once void Log(const char* message); void InitLog(); 其中主函数一直显示错误信息 ![image.png](https://wmlx-new-image.oss-cn-shanghai.aliyuncs.com/images/20241103/a123aa211fc0db7886753d0fc6d80628.png) 作为新手,我不是很清楚,我正常引用了头文件为什么会报错,求大佬解答一下

阅读量:24

点赞量:0

问AI
加班使我熟睡
可以说明一下你的 main.cpp 、 Log.cpp 、 Log.h 的路径吗?