Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7693 Discussions

Intel Compiler & stdc++fs & debug mode doesn't work

Wani__Nehal
Beginner
1,121 Views
$ cat main.x.cpp 
#include <iostream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main()
{
    std::cout << "Current path is " << fs::current_path() << '\n';
}

$ icpc main.x.cpp -lstdc++fs -std=c++14   # Works!


$ icpc main.x.cpp -lstdc++fs -std=c++14 -g   # Doesn't work
/spare/scratch/icpcNgdXiG.o: In function `std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::experimental::filesystem::v1::path::string<char, std::char_traits<char>, std::allocator<char> >(std::allocator<char> const&) const':
/spare/scratch/tmp-e31ZpjU-infra/gcc/5.4.0/include/c++/5.4.0/experimental/fs_path.h:822: undefined reference to `std::codecvt_utf8<char, 1114111ul, (std::codecvt_mode)0>::codecvt_utf8(unsigned long)'
/spare/scratch/tmp-e31ZpjU-infra/gcc/5.4.0/include/c++/5.4.0/experimental/fs_path.h:822: undefined reference to `std::codecvt_utf8<char, 1114111ul, (std::codecvt_mode)0>::~codecvt_utf8()'
/spare/scratch/tmp-e31ZpjU-infra/gcc/5.4.0/include/c++/5.4.0/experimental/fs_path.h:825: undefined reference to `std::codecvt_utf8<char, 1114111ul, (std::codecvt_mode)0>::~codecvt_utf8()'

$ icpc main.x.cpp -lstdc++fs -std=c++14 -g -mGLOB_opt_level=1  # Works!


This has been tested with Intel compilers 16 to 19 and the behavior is same.

0 Kudos
5 Replies
RahulV_intel
Moderator
1,121 Views

Hi,

It looks like a bug. We are able to reproduce this error. We will escalate this issue to the concerned team.

 

Rahul

Viet_H_Intel
Moderator
1,121 Views

I've opened a case with the compiler Developer. Case# is CMPLRIL0-32514. Thanks,

Viet_H_Intel
Moderator
683 Views

Can you use one of these workarounds?

$ icpc t3.cpp -std=c++14  -lstdc++fs -g -O1

$ icpc t3.cpp -std=c++14  -lstdc++fs -g -O2

$ icpc t3.cpp -std=c++14  -lstdc++fs -g -O3

$ icpx t3.cpp -std=c++14  -lstdc++fs -g

$


Thanks,





ArpitaP_Intel
Moderator
648 Views

Hi Nehal,


Could you please let us know if your issue is resolved or not?


Regards,

Arpita


PrasanthD_intel
Moderator
632 Views

Hi Nehal,


We are closing this thread as we haven't heard back from you. We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only


Regards

Prasanth


Reply