![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 48
Rep Power: 0
![]() |
socket tcp/ip
I'm new in the c++ tcp/ip socket programming.
Is there any website tutorial, or simple example for beginner? I've found some, but all are not understand. And i've try the example from msdn also... [PHP]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/complete_server_code.asp[/PHP] for both client and server example. but there 10 error in for client, and 13 error for server. eg. [PHP]server.obj : error LNK2001: unresolved external symbol __imp__send@16[/PHP] I just need to create a client to connect with a server. Client need to send a string message to server. How to do it? How to start? Please give me some guide... thanks |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
If you'd cared to search (the forums or even google), you'd find Beej.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#3 |
|
Hobbyist
Join Date: Sep 2005
Posts: 261
Rep Power: 4
![]() |
Hmm, why do I get the idea that you just copy/pasted the client/server code without actually reading the guide?
Possibly because if you had read the whole thing, you would know to link WS2_32.lib into your project? |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
I suggest Beej also. Google it.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Oct 2005
Posts: 48
Rep Power: 0
![]() |
:p i'm hope to get thing done as fast as i can so i din't do much research,
just copy and paste the example in msdn. thx ppl... i know what is the couse of the error... i include: #pragma comment(lib, "wsock32.lib") in the client.cpp and server.cpp. this solve my problem. Now i get the connection... still left some other logic to do.. ![]() |
|
|
|
|
|
#6 |
|
Hobbyist
Join Date: Sep 2005
Posts: 261
Rep Power: 4
![]() |
For the MSDN example you should be linking to: WS2_32.lib
which is the winsock 2 library. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|