I want to make a very simple c++ instant messenger for lan networks and internet (direct IP connect). I know little about sockets. I searched the internet, but nothing really helped. I would someone to suggest a howto/tutorial/guide. I just want to send and receive messages (in a console window, I'll create the gui later). I want it to be for both Linux and Windows. Thanks in advance!
Asked
Active
Viewed 1.5k times
8
-
None of the answers really helped. Thanks though. I tried Boost.Asio (it didn't compile), Qt (it works, but I do not know much about it) and the "codeproject.com" example but many problems occured. Can anybody suggest anything else? – Dec 09 '09 at 11:23
-
1what compiler/version did you use? which Boost release did you try? what were some of the "many problems" you had with Qt? will anything but a complete solution breastfed satisfy you? – just somebody Dec 17 '09 at 19:12
-
@just somebody: I didn't say that I have problems with Qt, but with the codeproject example. I used the GNU compiler for boost, but people also confirmed that there are problems with it. – Jan 09 '10 at 13:41
4 Answers
12
Checkout Boost.Asio. It's portable, and it's also got an example that implements a simple chat.

Björn Pollex
- 75,346
- 28
- 201
- 283
-
-
-
Download at http://www.boost.org/users/download/. You will have to do some reading to get this working though. – Björn Pollex Nov 30 '09 at 14:06
-
I get a linker error while trying to compile the example code in dev-c++: [Linker error] undefined reference to `_Unwind_Resume' Does anybody know how to fix it? – Nov 30 '09 at 15:45
-
from my experience, examples (of any boost libraries i've tried) don't always compile. try a different example file. or which example it is. or something. – just somebody Nov 30 '09 at 16:14
-
It is the only chat client example. I tried linking many different libs, but nothing worked. – Nov 30 '09 at 16:28
3
There's some source code here for a C/S chat application that you could probably use to get started.
Mas.

miPwn
- 1,166
- 1
- 13
- 29
-
-
@MaSuGaNa - I was wrong, it was a similar project of the same author which used a header I couldn't find. Is this only for windows, or I misunderstood? – Nov 30 '09 at 14:04
-
The code looks easy enough to modify for cross platform use. If you want something already written I'd go with Boost. – miPwn Nov 30 '09 at 14:26