2015-05-07 5 views
23

filesystem'u kullanmayı deniyorum. Benim CMakeLists.txt benim -std=c++11 -std=c++1y var. GCC versiyonu 4.9.2'dur.Neden <deneysel/dosya sistemi> öğesini g ++ 4.9.2 ile kullanamıyorum?

/home/loom/MyProject/src/main.cpp:5:35: fatal error: experimental/filesystem: No such file or directory 
#include <experimental/filesystem> 
           ^
compilation terminated. 

std::experimental::filesystem kullanmak doğru yolu nedir: Ancak, ben bir hata var? Biz libstdc++ status bakarsak

+0

Şimdilik sadece [kafa ile] çalışıyorum gibi görün (http://melpon.org/wandbox/permlink/abzPdCEgfwCCct22) –

cevap

25

biz onlar Dosya Sistemi için destek TS do görüyoruz:

Paper | Title | Status

........

N4100 | File System | Y

ama diyor ki:

This page describes the C++14 and library TS support in mainline GCC SVN, not in any particular release.

ve gelen

benzediğini Wandbox bu çalışıyor Bu kütüphane sadece son geliştirme şubesi 6.0'da mevcuttur ve bunun ötesinde daha fazla ayrıntı bulamıyorum. Jonathan Wakely dan

Güncelleme

Güncelleme: Jonathan Wakely en answer here buna göre de

It's also now available in the gcc-5-branch in Subversion, and will be included in the GCC 5.3 release later this year.

biz -lstdc++fs kullanarak derlemek gerekir. Bu Linking section of gcc documents kaplıdır:

GCC 5.3 includes an implementation of the Filesystem library defined by the technical specification ISO/IEC TS 18822:2015. Because this is an experimental library extension, not part of the C++ standard, it is implemented in a separate library, libstdc++fs.a, and there is no shared library for it. To use the library you should include and link with -lstdc++fs. The library implementation is incomplete on non-POSIX platforms, specifically Windows support is rudimentary.

Due to the experimental nature of the Filesystem library the usual guarantees about ABI stability and backwards compatibility do not apply to it. There is no guarantee that the components in any header will remain compatible between different GCC releases.

Ayrıca Table 3.1. C++ Command Options bakın.

+1

Ayrıca şimdi Subversion 'gcc-5-branch' da mevcuttur ve Bu yıl GCC 5.3 sürümü daha sonra yayınlanacak. –

+1

@JonathanWakely [bu soru] (http://stackoverflow.com/q/33149878/1708801) iyi bir sorudur. –

İlgili konular