Sign in to follow this  

Consoles and Winsock2

This topic is 4159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've just finished reading the long article on using Winsock2 with C++ . I learned some things from it but not enough to go through the Main.cpp and delete all the miscellanious DirectX code and have the bare Winsock2 stuff and be able to use it with a (I think) Win32 Console Application. So how do I use the winsock stuff with the console app? I'm trying to make a MUD (the MUD book didn't make sense to me on how to set up the Winsock stuff, so unless you can explain how to get me started with it don't post a link saying read this). Just a .cpp with a very simple console application input ouput multi-user would help me out a lot as a kind of 'template' to help me learn. Thx

Share this post


Link to post
Share on other sites
Thanks guys I'll start researching BSD, and since you said BSD is similar to WinSockets does that mean that it will not work on other operating systems besides Windows 95 and above as well?

Share this post


Link to post
Share on other sites
Again with this problem =( There's always the step you have to do so everything works under project settings and something else. But I can't find where that is. Not even my dad could find it and he works for Microsoft doing stuff with Visual Studios. So where is it? A hotkey to use it or anything?

Share this post


Link to post
Share on other sites
Quote:
There's always the step you have to do so everything works under project settings and something else.


It would be a lot easier to help if you told us what you were actually trying to do...

All you have to do to 'setup' winsock in MSVC++ is this...

#include <winsock2.h>
#pragma comment( lib, "WS2_32.lib" )

Share this post


Link to post
Share on other sites
Thanks Deyja that helps out, and btw I did say what I was trying to do:

"I'm trying to make a MUD" was in my first post. Which means I'm trying to make a multiplayer MUD.

Share this post


Link to post
Share on other sites
Quote:
Original post by Woad
Thanks Deyja that helps out, and btw I did say what I was trying to do:

"I'm trying to make a MUD" was in my first post. Which means I'm trying to make a multiplayer MUD.

Granularity. Given that making a MUD involves a ton of things that have nothing to do with networking and/or sockets, clearly that's a useless piece of information in this context. If you want quick and accurate help, you have to learn to give detailed and relevant information. Call it fair exchange, if you will.

Share this post


Link to post
Share on other sites
Well I was thinking it may be obvious enough to post about winsockets in the networking section and say I was making a MUD using Win32 Console App and have people understand i'm making a multiplayer text-based MUD . Next time I'll try to be more specific.

Share this post


Link to post
Share on other sites
I believe everyone is referring to this post, not the original post:

Quote:
Original post by Woad
Again with this problem =( There's always the step you have to do so everything works under project settings and something else. But I can't find where that is. Not even my dad could find it and he works for Microsoft doing stuff with Visual Studios. So where is it? A hotkey to use it or anything?


"the step you have to do so everything works" is incredibly vague. You don't mention what isn't working, so of course we can't tell you how to fix things.

Share this post


Link to post
Share on other sites
I'm assuming that you are trying to build the project, and you get errors.

For us to diagnose the errors, you need to copy the first few errors from the build output window, and paste them into your question.

You then have to copy the 10 lines around the area of the error in the source, and paste those, too. If those lines make reference to globals or custom data structures of yours, it would help to paste the definition of those, too.

Then, we can see what the problemis (the errors) and what the solution might be (your code). Asking for help without that information is like asking us to read your mind.

Share this post


Link to post
Share on other sites
No errors, I know I should post the part of the code I think is causing the problem and then post what the output window said the error(s) were.
*The step that makes everything work* is the step where you must click on the Project->Settings->All Configuration->Object Modules/something I forgot
I can't remember the exact step but a lot of tutorials say you need to do that, in fact Deyja solved the problem by just posting the code that does that, all tutorials say you can find it in some window somewhere (I know you probably can't understand anything after that comma but if you can then thumbs-up for you).
THAT was the problem (If there was some options to bold or underline i'd do that instead of caps).

Share this post


Link to post
Share on other sites
You will need to include the Winsock runtime library in your project.

About your signature: Why are you so confident so many people hate your country? Have you ever talked to them or visited their country?

Share this post


Link to post
Share on other sites
Quote:
Original post by Goldfish
About your signature: Why are you so confident so many people hate your country? Have you ever talked to them or visited their country?



it seems that he is rather selfish and/or confuses reality with movies..
also, I think it's stupid people like him who hates the rest of the world and not the other way around..

but let's try not to get offtopic..

Share this post


Link to post
Share on other sites

This topic is 4159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this