【问题标题】:I get the error "fatal error: Tablero.h: No such file or directory" when trying to compile C++I get the error \"fatal error: Tablero.h: No such file or directory\" when trying to compile C++
【发布时间】:2022-11-20 10:31:21
【问题描述】:

I'm learning C++ and trying to create a class but when I try to compile my codeit gives me this error. As you can see, the file "Tablero.h" is in the same folder as the main.cpp file. Is there any other step that i should take for g++ to find the file "Tablero.h"?

Here you can see the error and the file being in the folder.

Also, vscode seems to recognize the exists, since it autocompletes the name and labels it as a file (archivo in spanish).

Here you can see how vscode recognizes the existence of the file.

Thanks in advance!

I tried compiling different projects and reopening vscode but nothing worked.

【问题讨论】:

标签: c++ windows g++


【解决方案1】:

Try using #include "Tablero.h". Using <> checks headers in the standard library, but quotes "" look for headers in the local directory.

【讨论】:

    猜你喜欢
    • 2017-02-08
    • 1970-01-01
    • 1970-01-01
    • 2022-07-11
    • 2019-07-23
    • 2012-06-03
    • 1970-01-01
    • 2018-11-22
    • 2014-01-20
    相关资源
    最近更新 更多