In C 1z development, users attempting to leverage the new experimental::filesystem library have encountered a linker error. This issue is distinct from C 1z support, as experimental::filesystem is a separate specification.
To resolve the issue, users must link their code with the appropriate library. For GCC 5.3 and later, use the -lstdc fs flag:
g++ main.cpp -O2 -g -o go -lstdc++fs
This library should be placed after any objects that rely on it in the linker command since it is a static library.
Updates:
The above is the detailed content of How do I fix the linker error when using experimental::filesystem in C 1z?. For more information, please follow other related articles on the PHP Chinese website!