- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile a program that uses std::filesystem with Intel 19.1.2
since I could not configure the project, I decided to use gnu std library to have std::filesystem.
I tried to compile by loading both gcc (9.3.0) and intel compiler (19.1.2) and set the linker flag with:
add_link_options("-stdlib=libstc++")
as I have read it should link with the gnu stdlib, but I still get the error that
the c++ compiler does not support std::filesystem. How can I solve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
We are unable to reproduce any error with Intel 19.1.2 using the below-attached sample program that uses std::filesystem. You can refer to the screenshot attached for the desired output.
Sample code:
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
std::cout << "Current path is " << fs::current_path() << '\n';
}
Command:
icpc sample_file.cpp -lstdc++fs -std=c++17
./a.out
So, Could you please provide the reproducer code to investigate more on your issue?
>>>Since I could not configure the project, I decided to use gnu std library to have std::filesystem.
Could you please let us know the issues you are facing while using Intel 19.1.2?
>>>I still get the error that the c++ compiler does not support std::filesystem.
Could you also provide the screenshot of the error and command-line you have used to reproduce it?
Thanks & Regards
Shivani
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
We are unable to reproduce any error with Intel 19.1.2 using the below-attached sample program that uses std::filesystem. You can refer to the screenshot attached for the desired output.
Sample code:
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
std::cout << "Current path is " << fs::current_path() << '\n';
}
Command:
icpc sample_file.cpp -lstdc++fs -std=c++17
./a.out
So, Could you please provide the reproducer code to investigate more on your issue?
>>>Since I could not configure the project, I decided to use gnu std library to have std::filesystem.
Could you please let us know the issues you are facing while using Intel 19.1.2?
>>>I still get the error that the c++ compiler does not support std::filesystem.
Could you also provide the screenshot of the error and command-line you have used to reproduce it?
Thanks & Regards
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-lstdc++fs
compiling with this linking flag solves the problem for me as well, so I am accepting it as an answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks & Regards
Shivani

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page