filesystem library file cannot be recognized
Environment
- OS and Version: Windows 10
- VS Code Version: 1.84.0
- C/C++ Extension Version: v1.18.5
- If using SSH remote, specify OS of remote machine:
Bug Summary and Steps to Reproduce
Bug Summary: when debugging or running code, filesystem is not a member error of std occurs with the library imported and namespace specified my code is tested on CLion and Visual Studio with no errors Steps to reproduce:
- Open the code file
- Click on run/debug
- See error
Expected behavior: compile should pass without error
Configuration and Logs
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
Other Extensions
No response
Additional context
No response
Hi @zhiquan114514 . Could you provide example code? Can you clarify if the issue you are seeing is due to an IntelliSense error (squiggle), or something else? I'm able to use the filesystem header and namespace without any IntelliSense errors, with a simple example and default settings on Windows:
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main() {
// Define the path for the new directory
fs::path dirPath = "example_dir";
// Check if the directory already exists
if (!fs::exists(dirPath)) {
// Create the directory
fs::create_directory(dirPath);
std::cout << "Directory created: " << dirPath << std::endl;
} else {
std::cout << "Directory already exists: " << dirPath << std::endl;
}
return 0;
}
Assuming you're referring to an IntelliSense issue, could you provide the output of the C/C++: Log Diagnostics command while that file is open?
@Colengms I don't think it is a intelliSense error, I hit the debug button then everything appears. And I compile the example code you gave. However I do notice there there is a warning indicating that i am not using c++17 but actually I am using it.
Hi @zhiquan114514 . That warning would appear to be coming from another extension. Problems logged by the C/C++ Extension would be indicated as C/C++, not cpp.
This issue has been closed because it needs more information and has not had recent activity.