這邊插一句,若是你們學Erlang,建議仍是到 Linux環境下,這樣其實也是能學到很多知識,畢竟如今市面上主流的服務器都是Linux,因此若是你如今還只是會在Window下的這一套,那就來到Linux下學學吧。 html
搜索了不少資料都說到,若是庫不全的話,編譯安裝的時候會報各類錯誤,因此咱們站在巨人的肩膀上。 shell
首先,打好庫: 服務器
- sudo apt-get install build-essential
- sudo apt-get install libncurses5-dev
- sudo apt-get install libssl-dev
- sudo apt-get install m4
- sudo apt-get install unixodbc unixodbc-dev
- sudo apt-get install freeglut3-dev libwxgtk2.8-dev
- sudo apt-get install xsltproc
- sudo apt-get install fop
- sudo apt-get install tk8.5
安裝好上面到依賴以後,到官網下個源碼包:
http://www.erlang.org/download.html
對下到的包進行解壓並編譯安裝: 測試
- tar zxvf /home/lqg/下載/otp_src_R15B01.tar.gz
- cd /home/lqg/otp_src_R15B01/
- ./configure
- make && make install
這裏編譯通常不會出什麼錯誤,可能會有的是jdk環境的問題:No Java compiler found
這是你檢查下jdk 的環境就行了。 ui
最後,在終端輸入 erl es5
能夠進行erlang的shell測試了: spa
- 1> io:format("hello wlord").
- hello wlordok
- 2> io:format("hello wlord ~n").
- hello wlord
- ok
- 3> io:format("the output is: ~w ~w~n",[hello,world]).
- the output is: hello world
- ok
- 4> io:format("the output is: ~w~w~n",[hello,world]).
- the output is: helloworld
- ok
- 5> io:format("the output is: ~w~w~n",[hello,world]).
- the output is: helloworld
- ok