自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

淺談LevelDB在ubuntu 11.04下編譯失敗的問題

數(shù)據(jù)庫 其他數(shù)據(jù)庫 數(shù)據(jù)庫運維
我在最新的ubuntu11.04下編譯leveldb的時候發(fā)現(xiàn)問題,但是在更早前的這個版本很正常,頭文件cstdatomic找不到, 簡單的google下發(fā)現(xiàn)4.5的gcc這個頭文件改名成atomic。

我在***的ubuntu11.04下編譯leveldb的時候發(fā)現(xiàn)問題,但是在更早前的這個版本很正常:

  1. yufeng@yufeng-laptop:/usr/src/leveldb$ make   
  2. g++ -c -DLEVELDB_PLATFORM_POSIX -I. -I./include -std=c++0x -g2 db/db_bench.cc -o db/db_bench.o    
  3. In file included from ./port/port.h:14:0,    
  4.                  from ./util/coding.h:17,    
  5.                  from ./db/dbformat.h:13,    
  6.                  from ./db/db_impl.h:9,    
  7.                  from db/db_bench.cc:8:    
  8. ./port/port_posix.h:14:22: fatal error: cstdatomic: 沒有那個文件或目錄    
  9. compilation terminated.    
  10. make: *** [db/db_bench.o] 錯誤 1  

我的編譯環(huán)境:

  1. $ cat /etc/lsb-release    
  2. DISTRIB_ID=Ubuntu    
  3. DISTRIB_RELEASE=11.04    
  4. DISTRIB_CODENAME=natty    
  5. DISTRIB_DESCRIPTION="Ubuntu 11.04"   
  6. $ gcc -v   
  7. Using built-in specs.    
  8. COLLECT_GCC=/usr/bin/gcc-4.5.real    
  9. COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper    
  10. Target: x86_64-linux-gnu    
  11. Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' 
  12. --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs 
  13. --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
  14. --program-suffix=-4.5 --enable-shared --enable-multiarch 
  15. --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib 
  16. --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext 
  17. --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 
  18. --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ 
  19. --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold 
  20. --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-werror 
  21. --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu 
  22. --host=x86_64-linux-gnu --target=x86_64-linux-gnu    
  23. Thread model: posix    
  24. gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)  

頭文件cstdatomic找不到, 簡單的google下發(fā)現(xiàn)4.5的gcc這個頭文件改名成atomic

It seems that cstdatomic was renamed to atomic in newer GCC versions.Replacing cstdatomic include with atomic include  in the header worked for me.

 解決方法很簡單:

修改./port/port_posix.h:14 成

  1. #include  

現(xiàn)在再實驗下:

  1. $ make  
  2. ...  
  3. #跑測試案例  
  4. $ make check 

bingo, 玩得開心!

原文鏈接:http://blog.yufeng.info/archives/1319

【編輯推薦】

  1. LevelDB—一個超高性能的K/V數(shù)據(jù)庫
責任編輯:艾婧 來源: Erlang非業(yè)余研究
相關推薦

2011-08-09 15:47:46

LeveldbLinuxC++

2011-04-01 09:16:54

Ubuntu11.04JAVA

2011-05-03 10:40:58

Ubuntu 11.0應用

2011-09-16 14:03:56

2011-04-07 09:05:19

Ubuntu 11.0

2011-09-14 15:04:47

Android 2.2

2011-08-29 16:31:30

UbuntuAndroid

2011-01-12 10:15:08

Ubuntu 11.0

2011-09-15 15:08:27

2011-03-31 11:19:03

Ubuntu 11.0

2011-03-08 17:00:34

Ubuntu 11.0

2011-04-28 09:14:02

Ubuntu 11.0

2011-09-02 17:25:37

Ubuntu11.04gnome3

2011-07-01 13:31:29

Ubuntu Linux QVFB

2011-08-23 09:13:06

Ubuntu11.04DVD播放

2011-05-06 10:26:43

Ubuntu 11.0

2011-04-18 15:33:33

Ubuntu 11.0

2011-08-08 15:27:44

LevelDBLinux

2011-09-15 18:39:32

博客轉載

2011-05-05 11:02:55

Ubuntu 11.0 Medibuntu
點贊
收藏

51CTO技術棧公眾號