Reference website: https://github.com/libuv/libuv/blob/master/README.md
https://www.cnblogs.com/cnxkey/articles/10058702.html
A, libuv installation
1, the windows installed (herein vs2017 compiled)
-
Download libuv: https://github.com/libuv/libuv
-
Download gyp ( https://github.com/turbulenz/gyp ) placed under decompression after libuv / build
-
gyp installation requires python environment, download Python2.x ( https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi ) installation and configuration environment variable
-
Installation gyp: cmd enter libuv / build / gpy under execution: setup.py install
-
Open vs2017 compiler tool to compile 32-bit debug version here (start -> vs2017-> x86 tools, the right to run with administrator privileges)
-
libuv Installation: Switch to the project directory execute vcbuild vs2017
-
When finished, under construction Debug / lib will generate .lib library, copy it include engineering and .lib libraries to use
2, mounted under linux
-
Download libuv: https://github.com/libuv/libuv
-
Extracting tar -zxvf libuv-v1.32.0.tar.gz
-
If the lack of libtool library, please install yum install libtool
-
sh autogen.sh
-
./configure
-
make
-
make check (error disregard)
-
make install
-
Create a soft link ln -s /usr/local/lib/libuv.so.1 /usr/lib64/libuv.so.1
Two, libuv use
1), using the windows
1. Create a new project vs2017
2, add the directory containing libuv header files, libraries directory added libuv of .lib library
3, conflict Additional Dependencies add the required items lib library library caused ignored LIBCMTD
Additional Dependencies:
libuv.lib
ws2_32.lib
iphlpapi.lib
Userenv.lib
Psapi.lib
Ignore specific default library: LIBCMTD
4, you can compile the project
2) using the following linxu
1, it can perform the g ++ test.cpp -luv