Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Unix network programming ubuntu build environment to compile source code

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1. Download the source code for this book

(The source code is attached to the back of this blog post)

2. Extract the source code, enter unpv13e to view readme, follow the prompts

1) chmod u+x configure; add executable permissions to the configure file

./ configure

2)cd lib

make

3)(The following can be done according to README, some platforms cannot compile, my ubuntu will not work..., It does not affect)

3. Going back to the unpv13e directory, a libunp.a file has been generated below,

Copy this static library libunp.a into/usr/lib/and/usr/lib64/(mine is 64-bit ubuntu)

4. Next, find unp.h in lib directory and config.h in unpv13e directory. We will use these two header files in future code.

Copy these two files to the directory where we wrote our own code, and then open the unp.h file with a text editor,

#include "../ config.h"statement changed to #include "config.h", save

This environment is set up, but later compilation time in the need for gcc at the end of the-lunp import static library, for example:

gcc daytimetcpcli.c -o daytimetcpcli -lunp

Take the first example: daytimetcpchli

After compilation, execute: ./ daytimetcpcli 127.0.0.1

connection refused

The reason is that the local daytime service is not enabled. Let's enable the local daytime service (ubuntu12.04).

First install xinetd:

sudo apt-get install xinetd

Then edit the profile:

sudo vi /etc/xinetd.d/daytime

Change disable=yes to no and save to exit

Finally restart xinetd service

sudo /etc/init.d/xinetd restart

Attachment: down.51cto.com/data/2364162

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report