2017-07-09 3 views
0

私はQT5プロジェクトを古い学校の方法で、qmake && makeとコンパイルしようとしています。しかし、予期しないエラーが発生しています。そこ〜20ですが、ここではサンプリング(それらはすべて似ている)だ:STLネームスペースqstreamerのエラー/ qmake/make

以下
In file included from src/main.cc:18: 
In file included from include/Ctx.h:7: 
In file included from include/SrcFile.h:5: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/fstream:268:9: error: 
     no template named 'has_facet'; did you mean 
     '::std::has_facet'? 
    if (has_facet<codecvt<char_type, char, state_... 
     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:177:1: note: 
     '::std::has_facet' declared here 
has_facet(const locale& __l) _NOEXCEPT 
^ 
In file included from src/main.cc:18: 
In file included from include/Ctx.h:7: 
In file included from include/SrcFile.h:5: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/fstream:268:19: error: 
     no template named 'codecvt'; did you mean 
     '::std::codecvt'? 
    if (has_facet<codecvt<char_type, char, state_... 
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:817:86: note: 
     '::std::codecvt' declared here 
    ...class _StateT> class _LIBCPP_TYPE_VIS_ONLY codecvt; 
               ^
fatal error: too many errors emitted, stopping now 
     [-ferror-limit=] 
20 errors generated. 
make: *** [tmp/main.o] Error 1 

#ifndef SRCFILE_H 
#define SRCFILE_H 

#include <string> 
#include <fstream> 
#include "SrcObj.h" 


namespace oonalysis { 

class SrcFile : public SrcObj 
{ 
public: 
    SrcFile(const std::string& filename); 
    std::string get_text() const; 
    std::string present_name() const; 
private: 
    std::filebuf* get_file(); 
    std::string filename; 
}; // class SrcFile 

} // namespace oonalysis 

#endif // SRCFILE_H 

SrcFile.hれており、以下

INCPATH  = -I. -Iinclude -I/usr/local/Cellar/qt/5.9.1/lib/QtWidgets.fram 
ework/Headers -I/usr/local/Cellar/qt/5.9.1/lib/QtGui.framework/Headers -I/usr 
/local/Cellar/qt/5.9.1/lib/QtCore.framework/Headers -I. -I/Applications/Xcode 
.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12. 
sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode. 
app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.s 
dk/System/Library/Frameworks/AGL.framework/Headers -I/usr/local/Cellar/qt/5.9 
.1/mkspecs/macx-clang -F/usr/local/Cellar/qt/5.9.1/lib 
CC   = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang 
CXX   = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ 
CXXFLAGS  = -pipe -stdlib=libc++ -g -std=gnu++1y $(EXPORT_ARCH_ARGS) -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC $(DEFINES) 
tmp/srcfile.o: src/srcfile.cc include/SrcFile.h \ 
       include/SrcObj.h \ 
       include/oonalysis.h 
     $(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/srcfile.o src/srcfile.cc 
Makefileの生成の可能性が高いセグメントであるが

何かを誤って設定しましたか? 2つのstlバージョンを浮かべる方法はありますか?

+0

注:C++では、 '#include ' * * "fstream.h"は不要です。 –

+0

ありがとう、私は丁度孤立してヘッダーを議論するとき、命名法がまだfstream.hだったと仮定しました。 – Jeremy

答えて

0

問題は直感的ではありませんでした。関係のないヘッダーのgui.hでは、私はネームスペースguiを最後の括弧で閉じていませんでした。私は#include <fstream>をコメントアウトしてコンパイルしてこれを理解しました。今それは正常に動作します。