这边插一句,如果大家学Erlang,建议还是到 Linux环境下,这样其实也是能学到不少知识,毕竟现在市面上主流的服务器都是Linux,所以如果你现在还只是会在Window下的这一套,那就来到Linux下学学吧。
搜索了很多资料都说到,如果库不全的话,编译安装的时候会报各种错误,所以我们站在巨人的肩膀上。
首先,打好库:
- sudoapt-getinstallbuild-essentialsudoapt-getinstalllibncurses5-devsudoapt-getinstalllibssl-devsudoapt-getinstallm4sudoapt-getinstallunixodbcunixodbc-devsudoapt-getinstallfreeglut3-devlibwxgtk2.8-devsudoapt-getinstallxsltprocsudoapt-getinstallfopsudoapt-getinstalltk8.5
安装好上面到依赖之后,到官网下个源码包:http://www.erlang.org/download.html
对下到的包进行解压并编译安装:
- tarzxvf/home/lqg/下载/otp_src_R15B01.tar.gzcd/home/lqg/otp_src_R15B01/./configuremake&&makeinstall
这里编译一般不会出什么错误,可能会有的是jdk环境的问题:No Java compiler found这是你检查下jdk 的环境就好了。
最后,在终端输入 erl
可以进行erlang的shell测试了:
- 1>io:format("hellowlord").hellowlordok2>io:format("hellowlord~n").hellowlordok3>io:format("theoutputis:~w~w~n",[hello,world]).theoutputis:helloworldok4>io:format("theoutputis:~w~w~n",[hello,world]).theoutputis:helloworldok5>io:format("theoutputis:~w~w~n",[hello,world]).theoutputis:helloworldok
思念带着一种默默地忧伤,