Accustomed to the Mac programmer back to the Linux development platform always feel a bit uncomfortable, this is because the interface of Linux is not as beautiful as the Mac, and the Linux Package Manager is not as powerful as the homebrew on the Mac. When a Mac programmer encounters a library dependency problem, The first thing that comes to mind is brew search, and then home install. In comparison, although the Ubtuntu also provides apt package manager, but the above library resources is very old, because it is based on the installation of binary installation package, so the environment is very strict requirements, not satisfied directly cannot be installed. For example, :
sudo apt-get install mysql++
Because the MySQL version installed on the system is 5.7.12, the installation package that is hosted on the Ubuntu Package Manager server is only available for MySQL version 5.5.49, so it cannot be installed directly, is this not the pit daddy? Embrace the transformation and find that homebrew is also ported to the Linux platform, Install directly!
First attach the official website address: http://linuxbrew.sh/
Installation is simple: Execute the following command:
" $ (curl-fssl https://raw.githubusercontent.com/Linuxbrew/install/master/install) "
Note include the following in the environment variable:
Export path= "$HOME/.linuxbrew/bin: $PATH" Export path= "$HOME/.linuxbrew/sbin: $PATH"
Now you can enjoy the convenience of brew, encounter problems remember:
Home Doctor
Appendix:
Using Linuxbrew to install C + + library mysql++ and boost, I found that clion could not invoke these libraries correctly. The reason is that linuxbrew will link these libraries to the address:
$HOME/.linuxbrew/include$home/.linuxbrew/lib64
However, the path for Clion to find include and Lib by default is:
/usr/local//usr/local/lib
The workaround is simple, specify the include and LIB paths directly in the CMakeLists.txt file, and add the following two items to the file:
#视实际情况而定include_directories (/home/fit/.linuxbrew/include) link_directories (/home/fit/. LINUXBREW/LIB64)
Remember Reload project!
pass!
Using the Package Manager in Ubtuntu Linux-brew