Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Filesystem library: undefined reference to .extension()

M__Nabil
Beginner
2,479 Views

Hi!

I've attached some driver code to explain the filesystem library issue I'm facing with my larger project:

Test Code (test.cpp):

#include <iostream>
#include <experimental/filesystem>

namespace fs = std::experimental::filesystem;

int main() {
    std::cout << fs::path("").extension() << std::endl;
    
    return 0;
}

Compilation commands (tried both):

icc test.cpp -lstdc++fs -std=c++17

icpc test.cpp -lstdc++fs -std=c++17

Here's what's spit out:

In function `main':
test.cpp:(.text+0x79): undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_find_extension[abi:cxx11]() const'

ICC Version:

icc (ICC) 19.0.3.199 20190206

OS Version (as reported by cat /etc/issue):

Ubuntu 18.04.2 LTS

Could this be related to: https://software.intel.com/en-us/forums/intel-c-compiler/topic/844541 ??

0 Kudos
1 Solution
M__Nabil
Beginner
2,479 Views

Woops! Sorry, yes you can close the thread. Turns out the cluster I'm trying to compile on has a half-baked installation of ICC >.> Thanks for the speedy response :)

View solution in original post

0 Kudos
4 Replies
RahulV_intel
Moderator
2,479 Views

Hi,

We are able to compile/run the same code on our machine.

This looks like a linking error on your machine. Can you confirm whether you have the corresponding “.a” file for the library?

 

Rahul

0 Kudos
RahulV_intel
Moderator
2,479 Views

Hi,

Let us know whether we can close the thread.

0 Kudos
M__Nabil
Beginner
2,480 Views

Woops! Sorry, yes you can close the thread. Turns out the cluster I'm trying to compile on has a half-baked installation of ICC >.> Thanks for the speedy response :)

0 Kudos
RahulV_intel
Moderator
2,478 Views

Hi,

Thanks for the confirmation. We are closing this thread. Feel free to reach out to us in case of any more issues.

 

-Rahul

0 Kudos
Reply