2013-11-25 170 views
2

我遇到了NuGet和boost的問題。我已經安裝了boost庫和boost_thread庫,並在之前使用它們,在我的項目中沒有任何問題。NuGet Boost包括不工作

在安裝boost_serialization並從我的git master repo中提取更改後,我的項目打破了。

下面是來自packages.config文件git的差異:

1 <?xml version="1.0" encoding="utf-8"?> 
2 <packages> 
    - <package id="boost" version="1.54.0.157" targetFramework="Native" /> 
    - <package id="boost_chrono-vc110" version="1.54.0.157" targetFramework="Native" /> 
    - <package id="boost_date_time-vc110" version="1.54.0.157" targetFramework="Native" /> 
    - <package id="boost_system-vc110" version="1.54.0.157" targetFramework="Native" /> 
    - <package id="boost_thread-vc110" version="1.54.0.157" targetFramework="Native" /> 
3 + <package id="boost" version="1.55.0.10" targetFramework="Native" /> 
4 + <package id="boost_chrono-vc110" version="1.55.0.10" targetFramework="Native" /> 
5 + <package id="boost_date_time-vc110" version="1.55.0.10" targetFramework="Native" /> 
6 + <package id="boost_serialization-vc110" version="1.55.0.10" targetFramework="Native" /> 
7 + <package id="boost_system-vc110" version="1.55.0.10" targetFramework="Native" /> 
8 + <package id="boost_thread-vc110" version="1.55.0.10" targetFramework="Native" /> 
9 </packages> 

從vcxproj文件git的差異有關章節:

<ImportGroup Label="ExtensionTargets"> 
- <Import Project="packages\boost.1.54.0.157\build\native\boost.targets" Condition="Exists('packages\boost.1.54.0.157\build\native\boost.targets')" /> 
- <Import Project="packages\boost_thread-vc110.1.54.0.157\build\native\boost_thread-vc110.targets" Condition="Exists('packages\boost_thread-vc110.1.54.0.157\build\native\boost_thread-vc110.targets')" /> 
- <Import Project="packages\boost_system-vc110.1.54.0.157\build\native\boost_system-vc110.targets" Condition="Exists('packages\boost_system-vc110.1.54.0.157\build\native\boost_system-vc110.targets')" /> 
- <Import Project="packages\boost_date_time-vc110.1.54.0.157\build\native\boost_date_time-vc110.targets" Condition="Exists('packages\boost_date_time-vc110.1.54.0.157\build\native\boost_date_time-vc110.targets')" /> 
- <Import Project="packages\boost_chrono-vc110.1.54.0.157\build\native\boost_chrono-vc110.targets" Condition="Exists('packages\boost_chrono-vc110.1.54.0.157\build\native\boost_chrono-vc110.targets')" /> 
+ <Import Project="packages\boost_chrono-vc110.1.55.0.10\build\native\boost_chrono-vc110.targets" Condition="Exists('packages\boost_chrono-vc110.1.55.0.10\build\native\boost_chrono-vc110.targets')" /> 
+ <Import Project="packages\boost_date_time-vc110.1.55.0.10\build\native\boost_date_time-vc110.targets" Condition="Exists('packages\boost_date_time-vc110.1.55.0.10\build\native\boost_date_time-vc110.targets')" /> 
+ <Import Project="packages\boost_system-vc110.1.55.0.10\build\native\boost_system-vc110.targets" Condition="Exists('packages\boost_system-vc110.1.55.0.10\build\native\boost_system-vc110.targets')" /> 
+ <Import Project="packages\boost_thread-vc110.1.55.0.10\build\native\boost_thread-vc110.targets" Condition="Exists('packages\boost_thread-vc110.1.55.0.10\build\native\boost_thread-vc110.targets')" /> 
+ <Import Project="packages\boost_serialization-vc110.1.55.0.10\build\native\boost_serialization-vc110.targets" Condition="Exists('packages\boost_serialization-vc110.1.55.0.10\build\native\boost_serialization-vc110.targets')" /> 
+ <Import Project="packages\boost.1.55.0.10\build\native\boost.targets" Condition="Exists('packages\boost.1.55.0.10\build\native\boost.targets')" /> 
    </ImportGroup> 

好像依賴的版本更新太。我試圖把它改回到1.54,但它也沒有解決問題。我得到這樣的錯誤:

智能感知:無法打開源文件 「助推/存檔/ text_oarchive.hpp」

我試着包括它用

#include <boost/archive/text_oarchive.hpp> 

#include "boost/archive/text_oarchive.hpp" 

如何我解決這個問題嗎?

EDIT1:其他信息是,我已經開始使用GitHub而不是TortoiseGit。不知道這是否重要。

+0

與[this]有什麼關係(http://isocpp.org/blog/2013/11/boost-migrating)也許? –

+0

不,Boost 1.55 Nuget包與Boost遷移無關。 –

回答

2

通過重新安裝NuGet擴展程序解決了問題。

+0

您現在使用哪個版本的Boost 1.55或1.54? –

+0

1.55最新版本。 – VSZM