Sign in to follow this  
nivlekio

Setting up Winsock application in VS2005?

Recommended Posts

nivlekio    156
The problem starts of with my application, when ever I try it on my friends pc i get a windows messages saying it was not set up properly and needs to be reinstalled. But when i run the exe on my pc it runs fine. When i complie the program i get no error's. So done as you guys suggested and installed VS2005 and VS2008 redistubitible exe's on my friends pc. Then tried it again and got the same error, so I thought there must be something with my code. I looked at it like a million times nothing looked wrong ( i think ). I took an example from the Multiplayer Game Programming book cd (Uber Adventure) and tried it on my friends pc and it worked fine. I ran the server exe on his and the client exe on mine and we comminucated no probz. So I copied the example project and added my own code file(had to convert it from a older version of VS), and removed his own files. I compiled that project and no errors, then ran it on my friends pc and it worked fine. So the problem is how i set up my project for winsock the application. To double check i did not make a mistake 1st time i made another project and added the files and got the same error on my friends pc. This is how set up my project the second time same way as the first: What i did was open up VS2005 then i did these following steps File -> New -> Project. Under the New project Window. Visual C++ -> Win32 -> Win32 Console Application. Gave it a name and clicked on "Ok". Under the Win32 Application wizard. Clicked on Next. Ilicked on "Console Application" and clicked on "Empty project". Then clicked on finish. I added existing files from the previous project into the new project folder and added them in to the project. I then went to Project -> Properties. Then under General i changed "Use Unicode Character Set" to "Use Multi-byte character set" when ever i use "Use Unicode Character Set" in other projects it gives me errors even when code is correct donno why this happens. Under Linker -> Input -> Additional Dependicies. I added the "wsock32.lib" library. compiled it and ran it on my pc no probs, then tried on friends pc got the same error. I also tried the adding the "ws2_32.lib" file inplace of "wsock32.lib" file in the Project -> Properties -> Linker -> Input -> Additional Dependicies. that did not change anything. Is there something I am doing wrong or forgot to add? Also what is the diffrence between "ws2_32.lib", "wsock32.lib" ? Thanks for the help in advance :D.

Share this post


Link to post
Share on other sites
Antheus    2409
Quote:
compiled it and ran it on my pc no probs, then tried on friends pc got the same error.


This is somewhat self-conflicting description of the problem.

Also, winsock is application agnostic. There is no "winsock" application. It's just a library.

You might start by posting the actual error message you get you get.

Share this post


Link to post
Share on other sites
nivlekio    156
Quote:

Quote:

compiled it and ran it on my pc no probs, then tried on friends pc got the same error.




This is somewhat self-conflicting description of the problem.

Also, winsock is application agnostic. There is no "winsock" application. It's just a library.

You might start by posting the actual error message you get you get.


sorry i ment to say compiled it and ran it on my computer had no errors, then when i ran it on my friends pc i got a windows error message saying

Quote:

C:\Projects\OgreNetworkUDPv0.2\Debug\OgreNetworkUDP.exe

The application failed to start becuase the application configuration is incorrect. Reinstalling the application may fix this problem


Thats the windows error message i get on my friends pc.

Share this post


Link to post
Share on other sites
Antheus    2409
Quote:
C:\Projects\OgreNetworkUDPv0.2\Debug\OgreNetworkUDP.exe


Redistributables are only for release build. You could actually find debug libraries, but you're not allowed to redistribute them.

Long story short - make a release build.

Share this post


Link to post
Share on other sites
CodeMunkie    805
That has nothing to do with Winsock. Your program is looking for dependencies that are missing the target machine. This particular error sounds like you need to distribute the correct Visual C++ side by side assemblies. You can use a program like Depends.exe to figure out exactly which libraries are missing. Also, check your executable's manifest and make sure you are distributing the correct version that your exe is linked with.

You could also just statically link with the Visual C++ runtime if you want to make things simple.

Share this post


Link to post
Share on other sites
nivlekio    156
Thanks Antheus once again :D it worked :D grrrr kinda annoyed my lecturer did not tell me about that lol, will need to buy me self a VS book some time soon hehe.

And also thanks CodeMunkie for the info :D that will prolly come usefull some time :).

you guys rock! was ripping out my hair lol.

Share this post


Link to post
Share on other sites

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