2011-10-09 26 views
1

的成員與編譯:atomic_thread_fence是不是性病

g++ -std=c++0x -Wall -pthread test2.cc -o hello 

我得到這個錯誤:

test2.cc: atomic_thread_fence is not a member of std 

我在Ubuntu中使用G ++ 4.5.2。我錯過了什麼?

+0

這看起來像一個外部庫 - 是否根據其文檔安裝了它?你是否像使用它在文檔中描述的那樣使用它? – vstm

+3

將'test2.cc'的來源添加到問題中。 – Mankarse

+0

這是一本書的例子,它寫std :: atomic_thread_fence –

回答

1

你在test2.cc中有以下內容嗎?

#include <atomic> 
+0

它有這個頭,但刪除std ::或者不是相同的錯誤 –