我在裝了boost的XE10.1下寫了一個小程式,測驗一個safequeue的template頭檔案。里面宣告了幾個boost的組件,運行起來良好,不需要添加任何boost庫路徑include,只是加入#include "safequeue.h"即可以使用。
#include <mutex>
#include <queue>
#include <condition_variable>
#include <memory>
#include <atomic>
接著我把這個頭檔案復制進一個現有的工程里(那里從來沒呼叫過boost)。可是那里卻曝出:
[bcc32 Error] safequeue.h(4): E2209 Unable to open include file 'mutex'
[bcc32 Error] functional(813): E2238 Multiple declaration for 'operator hash<string>::()(const string &) const'
[bcc32 Error] functional(794): E2344 Earlier declaration of 'operator hash<string>::()(const string &) const'
[bcc32 Error] functional(838): E2238 Multiple declaration for 'operator hash<wstring>::()(const wstring &) const'
[bcc32 Error] functional(794): E2344 Earlier declaration of 'operator hash<wstring>::()(const wstring &) const'
[bcc32 Error] safequeue.h(6): E2209 Unable to open include file 'condition_variable'
[bcc32 Error] safequeue.h(8): E2209 Unable to open include file 'atomic'
[bcc32 Error] safequeue.h(61): E2316 'mutex' is not a member of 'std'
[bcc32 Error] safequeue.h(61): E2040 Declaration terminated incorrectly
[bcc32 Error] safequeue.h(62): E2316 'condition_variable' is not a member of 'std'
[bcc32 Error] safequeue.h(62): E2040 Declaration terminated incorrectly
[bcc32 Error] safequeue.h(64): E2316 'atomic' is not a member of 'std'
...
我覺得IDE是想在std library里找mutex等boost的組件。
我現在工程里添加boost的路徑也沒有用,我不知道為什么?
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/71239.html
標籤:基礎類
上一篇:windows遠程除錯(eclipse mingwx64)
下一篇:install componet添加64位.bpl檔案報錯Can't load package...%1不是有效的win32應用程式
