本文介绍了为什么还必须使用-lstdc ++ fs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于获取编译为最新版本的GCC和Clang:

There have been several questions about getting experimental/filesystem to compile in the latest versions of GCC and Clang: experimental::filesystem linker error

但是现在已被接受为,因此不再需要实验性 -lstdc ++ fs 标志,对吗?

But now filesystem has been accepted into c++17 so no more need for experimental or the -lstdc++fs flag, right?

错误我什至不能 #include< filesystem> clang ++ g ++ 的头版上的c $ c>:

Wrong I cannot even #include <filesystem> on the head version of either clang++ or g++ when I try on: http://melpon.org/wandbox

还有其他一些论点吗?需要? -lstdc ++ fs 只是给我提供了实验性版本,如何包含正式接受的版本?

Is there still some other argument I need? -lstdc++fs just gives me the experimental version, how can I include the officially accepted version?

推荐答案

在C ++标准中没有指定必须如何调用编译器。取决于实现方案,因此可能仍然需要 -lstdc ++ fs

It is not specified in the C++ standards how exactly you must invoke your compiler. I guess this is up to implementations to decide, so there might still be a need for -lstdc++fs.

请注意,C ++ 17尚未正式成为标准,实现可能已经实现,也可能尚未实现。即使C ++ 17最终成为标准,这也不会神奇地改变实现。它甚至都没有定义实现应该或不需要的链接标志。它是完全无关的。

Note that C++17 is not yet officially a standard, and implementations may or may not yet have implemented it. Even when C++17 finally becomes a standard, this won't magically change the implementation. It doesn't even define what linker flags an implementation should or should not require. It is completely unrelated.

在C ++ 17成为标准并且您的实现开始支持它之后,如何包括正式接受的版本,完全取决于实现。我们可能只需要等待,看看效果如何。

How you can include the officially accepted version after C++17 becomes a standard and your implementation begins to support it, is completely implementation-specific. We'll probably just have to wait and see how that works out.

这篇关于为什么还必须使用-lstdc ++ fs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 05:54