-
Notifications
You must be signed in to change notification settings - Fork 36
Manual compilation Guide
rsocker_not_sucker edited this page Jun 12, 2018
·
8 revisions
Chinese version can be found here
Dependent libray list: libuv, libnet, libpcap/winpcap, libdnet
NOTE: On Ubuntu, libdnet is named libdumbnet. And you must modify some code of rosck. Simply replace dnet.h
with dumbnet.h
in rsock src code.
Take Ubuntu as an example:
sudo apt-get install g++ libuv1-dev libnet1-dev libpcap-dev libdumbnet-dev
git clone https://github.com/iceonsun/rsock.git rsock
cd rsock
mkdir build && cd build
cmake .. -DRSOCK_RELEASE=1 && make
To accelerate compilation, you can specify -jNumOfCpuCores. e.g make -j2
note: libuv must be libuv1-dev, not libuv-dev. The libuv1-dev is the newer version.
- pkg install gcc cmake git libnet libuv libpcap libdnet
- git clone https://github.com/iceonsun/rsock.git
- cd rsock
- Edit CMakeLists.txt, After line
include_directory(./src/os/include/)
, add following lines:
link_directories(/usr/local/lib/)
include_directories(/usr/local/include)
- mkdir build && cd build
- cmake -DRSOCK_RELEASE=1 .. && make
I suggest to use binary provided. If you want to compile yourself. If you insist on compiling your self, here are steps needed to be done:
- Install winpcap AND winpcap developer pack. In winpcap developer packet, we can find wpcap.lib and Packet.lib.
- Compile libuv or use one provided in repo. Compile it in shared mode. The default mode is static linking. You can resort to libuv REAMDE
- Compile libnet or use on provided in repo. You can resort to libnet page on here
- cd path/to/rsock
- mkdir build
- Manually compile libdnet. I didn't manage compile it. The dnet.dll in rsock is extraced from libdnet source code. Recompiled those code output the .dll.
- Copy libnet.lib, wpcap.lib, Packet.lib, dnet.dll and libuv.lib to build. And rename them to net.lib, uv.lib.
- Edit CMakeFileLists.txt to include net, uv, wpcap, packet.
- cd build && cmake ..
- Open visual studio and then generate target.
- copy libnet.dll and libuv.dll generated in previous steps to build directory. Don't rename dll files.
- And then you can execute binary now.