2011-03-11 121 views
2

我想在項目中使用google-ctemplate。但是,如果我有基本的文件,我得到以下錯誤(使用Visual Studio C++ 2005):爲什麼Visual Studio找不到'tr1/unordered_map?

Error 1 fatal error C1083: Cannot open include file: 'tr1/unordered_map': No such file or directory f:\entwicklung\libraries\ctemplate-0.99\src\ctemplate\template_cache.h 39 

我能找到在升壓目錄unordered_map.hpp和升壓目錄被設置在包括在Visual Studio中的路徑。我怎麼解決這個問題?

回答

4

我發現問題是什麼。我從google-ctemplate包含了錯誤的目錄。而不是src我必須使用src/windows

但這會觸發另一個問題,這次是從鏈接器。

0

由於是,你可以使用:

#include <boost/tr1/unordered_map.hpp> 

或者,您$(升壓目錄)/升壓/ TR1/TR1到包括路徑和使用:

#include <unordered_map> 

見本Header Include Style瞭解更多詳情。

注:我假設$(boost-directory)被設置爲類似於「C:\ boost_1_46_0」。

0

考慮到TR1直到2005年夏天才發佈,我不會感到驚訝的是它沒有出現在VS 2005中。您可能會嘗試更新的編譯器版本!

相關問題