ubuntu編譯btc
㈠ 如何在ubuntu linux安裝編譯器,實現hello,word
1,安裝配置GCC編譯器:
在Ubuntu安裝完成已經有GCC了(GCC是由GNU之父Stallman所開發的Linux下的編譯器,全稱為GNU Compiler Collection, 目前可以編譯的語言包括:C, C++, Objective-C, Fortran, Java, and Ada.).但是GCC還不能編譯文件.因為缺少一些頭文件.那麼我們就要來配置這些頭文件.在這里我們需要安裝build-essential這個軟體包,安裝了這個包會自動安裝上g++,libc6-dev,linux-libc-dev,libstdc++6-4.1-dev等一些必須的軟體和頭文件的庫.
ctrl+alt+t 進入圖像模式終端界面(注意:ctrl+alt+f1字元模式終端界面 ,一般都用圖像模式終端界面)
安裝build-essential:在終端界面裡面輸入sudo apt-get install build-essential
2,查看安裝的gcc版本號:
gcc --version
3,vi和vim的區別:
vi和vim都是Linux中的編輯器,不同的是vim比較高級,可以視為vi的升級版本。vi使用於文本編輯,但是vim更適用於coding。
4,利用vi編輯器新建文件 終端輸入:vi helloworld.c ,進入編輯寫代碼。
5,寫完代碼後在底模式wq保存退出。
6,終端輸入輸入 gcc helloworld.c,編譯生成a.out文件。
7, 終端輸入輸入 ./a.out 運行程序。
㈡ 如何在windows平台下編譯比特幣bitcoin客戶端
你要編譯windows版的比特幣程序,基本上有兩種方法,一種是在linux平台
(推薦ubuntu 13.10)通過交叉編譯的方法來編譯.另外一種,就是直接在windows平台編譯.
我想,你既然要在windows平台使用,我就詳細介紹一下如何在windwows平台編譯比特幣程序.
我的平台:windows7
第一步:安裝變編譯環境QT和MINGW,msys
1、msys是一個在windows平台模擬shell的程序。
下載安裝程序之後,通過安裝管理程序,按安裝以下內容:
From MinGW installation manager -> All packages -> MSYS
選中以下安裝包
msys-base-bin
msys-autoconf-bin
msys-automake-bin
msys-libtool-bin
點 apply changes開始安裝。他會自動下載安裝好。
需要注意的是,確保不要安裝msys-gcc和msys-w32api ,因為這兩個包和我們的編譯系統發生沖突。
很多人出現一些莫名其妙的問題,就是因為這兩個包。
2、安裝 MinGW-builds
下載並解壓縮 i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z 到C盤根目錄 C:\
注意我的目錄結構。你盡量和我一樣。
3、設置PATH環境變數,將C:\mingw32\bin;添加到第一個。
4、在命令行模式下輸入 gc -v 會得到以下內容
c:\gcc -v
Using built-in specs.
COLLECT_GCC=c:\mingw32\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.8.2/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../../../src/gcc-4.8.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw482/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw482/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev3, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/include -I/c/mingw482/prerequisites/i686-zlib-static/include -I/c/mingw482/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw482/i686-482-posix-dwarf-rt_v3-rev3/mingw32/opt/lib -L/c/mingw482/prerequisites/i686-zlib-static/lib -L/c/mingw482/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware'
Thread model: posix
gcc version 4.8.2 (i686-posix-dwarf-rev3, Built by MinGW-W64 project)
至此,你的開發環境已經搭建好了,很簡單吧~!