Archived

This topic is now archived and is closed to further replies.

Temer

Trouble with Winsock 2 Tutorial

Recommended Posts

Hey, I am having trouble compiling the winsock 2 tutorial. My understanding of the source is that main.cpp is the client application. This is the portion I am having trouble compiling. I get these errors: c:\temp\ws2\dxlib.h(168) : error C2146: syntax error : missing '';'' before identifier ''lpdd'' c:\temp\ws2\dxlib.h(168) : fatal error C1004: unexpected end of file found However, I checked dxlib.h and I really don''t see anything wrong with it. I''ve made no changes to the source. Is anyone else having this problem? How do I fix it? Thanks, Temer

Share this post


Link to post
Share on other sites
I''m getting the same error when i try to compile a different project that a friend of mine gave me..... I''ve tried Build ALl and whatnot to no avail... if anyone has had the same problems and has a clue of what''s going on please let us know.... thanks!

Share this post


Link to post
Share on other sites
I didn''t forget anything cause I didn''t write the source. However I checked the file and there isn''t a missing semicolon. I welcome someone else to try to compile the client application in the Winsock 2 Tutorial on gamedev.net cause it isn''t compiling for me. I want to see if there is something wrong with my setup or something. So please someone else try to compile the client app of the winsock tut.

quote:
Original post by Muzzafarath

You have probably forgotten a semicolon somewhere before you #included dxlib.h.

/. Muzzafarath
Mad House Software


Share this post


Link to post
Share on other sites
Hi!

Just took a look at the sources and they looked fine. The error you are getting is because the compiler doesn''t know the LPDIRECTDRAW7 type. Since the header file DOES include ddraw.h, my guess would be that you don''t have the DirectX 7 SDK (you probably have some older version, or otherwise ddraw.h wouldn''t have been found).

BTW, VC++ error messages ... I hate them for being so useless most of the time.

Take care,

MK42

Share this post


Link to post
Share on other sites
Hey,

I do have DxSDK 7 cause I downloaded it the other day. I know it is 7 cause it installed itself to dxsdk7 dir. So, did you try compilin the src or did you just look at it? I don''t know what else to do with this crap. I really want to learn winsock and this is holdin me up.

Share this post


Link to post
Share on other sites
Well it all compiles perfect for me once i added all the directx and the winmm lib files in my project. It even runs too. What i have done is copied all the dx7 headers and libs from the dx7sdk install dir and overwrote the older directx headers and libs in my vc++ include and lib folders. I really dont know what else to tell you b/c it runs fine for me.

-Snyper

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Temer, make sure you have REPLACED your old DirectX include and header files in VCs include and lib directorys.
just putting c:/mssdk/lib or whatever in the search path for VC won''t do, ''cause it will look in VCs include directory first.
so you have to remove or replace your old DirectX include and library files.

... i''m fucking tired, so the explanation is poor... anyway, please post a message and tell me if it worked.

//Siigron

Share this post


Link to post
Share on other sites
Hi!

I did NOT compile the demo program, but I know my VC++ error messages. This is the only POSSIBLE error you can have. The Anon-Poster stated the problem correctly. Under the VC++ options you can specify the search directories for libraries and header files. Make sure that the paths to the DirectX 7 SDK lib and include directories come before ANYTHING else. There is probably a DirectX 3.0 version installed (comes with VC++), which can cause problems.

Happy coding,

MK42

Share this post


Link to post
Share on other sites
Great News,

I got it to compile. I copied all of the new DxSDK7 files straight to the VC folders. BUt now I got some other stuff. I just want to know did everyone get a bunch of warnings about converting from float to int loss of data like these:

c:\temp\dxlib.cpp(95) : warning C4244: ''='' : conversion from ''double'' to ''float'', possible loss of data
c:\temp\dxlib.cpp(96) : warning C4244: ''='' : conversion from ''double'' to ''float'', possible loss of data
c:\temp\dxlib.cpp(228) : warning C4244: ''='' : conversion from ''float'' to ''int'', possible loss of data
c:\temp\dxlib.cpp(231) : warning C4244: ''='' : conversion from ''float'' to ''int'', possible loss of data
c:\temp\dxlib.cpp(262) : warning C4244: ''='' : conversion from ''int'' to ''float'', possible loss of data
c:\temp\dxlib.cpp(278) : warning C4244: ''='' : conversion from ''int'' to ''float'', possible loss of data
c:\temp\dxlib.cpp(332) : warning C4244: ''='' : conversion from ''int'' to ''float'', possible loss of data
c:\temp\dxlib.cpp(348) : warning C4244: ''='' : conversion from ''int'' to ''float'', possible loss of data
c:\temp\dxlib.cpp(1245) : warning C4390: '';'' : empty controlled statement found; is this the intent?
c:\temp\dxlib.cpp(1253) : warning C4390: '';'' : empty controlled statement found; is this the intent?
Main.cpp

Also it says there is no resource.h included. what''s up with that?

Share this post


Link to post
Share on other sites
Great News... I got it to compile error and warning free. Now how do I change entry of the address of the server in the client applet. right now it is set to 127.0.0.1 and I want to change it but it won''t let me. other than that this is great!

Share this post


Link to post
Share on other sites