C++ Winsock Networking Tutorials [04-24-2017]
Re: C++ Winsock Networking Tutorials [11-16-2016]
Oh yea and then i could just make client inside a game object and make a function to get a pointer to client , and should i worry about all those warnings ?
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: C++ Winsock Networking Tutorials [11-16-2016]
I'm not getting any warnings related to the client when I compile it.egizz983 wrote:Oh yea and then i could just make client inside a game object and make a function to get a pointer to client , and should i worry about all those warnings ?
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
Re: C++ Winsock Networking Tutorials [11-16-2016]
Could u upload me that solution ?
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: C++ Winsock Networking Tutorials [11-16-2016]
Sorry just saw your post. I edited the original post where I explained the changes to be made with the solution.
http://forum.planetchili.net/download/file.php?id=2296
http://forum.planetchili.net/download/file.php?id=2296
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
Re: C++ Winsock Networking Tutorials [11-16-2016]
Okay this is what i get with my current solution
and with solution i download from you i get same just couple more warnings
Code: Select all
1>c:\users\winfows\desktop\game\engine\ChiliWin.h(24): warning C4005: '_WIN32_WINNT': macro redefinition (compiling source file Game.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\shared\sdkddkver.h(200): note: see previous definition of '_WIN32_WINNT' (compiling source file Game.cpp)
1>c:\users\winfows\desktop\game\engine\ChiliWin.h(63): warning C4005: 'STRICT': macro redefinition (compiling source file Game.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\shared\minwindef.h(23): note: see previous definition of 'STRICT' (compiling source file Game.cpp)
1>c:\users\winfows\desktop\game\engine\ChiliWin.h(24): warning C4005: '_WIN32_WINNT': macro redefinition (compiling source file MainWindow.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\shared\sdkddkver.h(200): note: see previous definition of '_WIN32_WINNT' (compiling source file MainWindow.cpp)
1>c:\users\winfows\desktop\game\engine\ChiliWin.h(63): warning C4005: 'STRICT': macro redefinition (compiling source file MainWindow.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\shared\minwindef.h(23): note: see previous definition of 'STRICT' (compiling source file MainWindow.cpp)
1>c:\users\winfows\desktop\game\engine\ChiliWin.h(24): warning C4005: '_WIN32_WINNT': macro redefinition (compiling source file Main.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\shared\sdkddkver.h(200): note: see previous definition of '_WIN32_WINNT' (compiling source file Main.cpp)
1>c:\users\winfows\desktop\game\engine\ChiliWin.h(63): warning C4005: 'STRICT': macro redefinition (compiling source file Main.cpp)
1> C:\Program Files (x86)\Windows Kits\8.1\Include\shared\minwindef.h(23): note: see previous definition of 'STRICT' (compiling source file Main.cpp)
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: C++ Winsock Networking Tutorials [11-16-2016]
I hadn't realized that those errors were not there before you added the Client.h.
I don't think it will matter, but you can always remove the redefinitions from ChiliWin.h if it becomes an issue or if you need to get rid of the warnings.
I don't think it will matter, but you can always remove the redefinitions from ChiliWin.h if it becomes an issue or if you need to get rid of the warnings.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
Re: C++ Winsock Networking Tutorials [11-16-2016]
Another problem i cant make Client object , if i try to make him inside a GameState i get pretty much same as before mowing client.h to mainwindow , and if i try to make client inside game object i get gives me an error that i cannot create incomplete type object .
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: C++ Winsock Networking Tutorials [11-16-2016]
Yeah sorry I am having issues figuring out the correct order to have all of the includes and have it work properly in this project. If anyone else sees an easy way around this please chime in.egizz983 wrote:Another problem i cant make Client object , if i try to make him inside a GameState i get pretty much same as before mowing client.h to mainwindow , and if i try to make client inside game object i get gives me an error that i cannot create incomplete type object .
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: C++ Winsock Networking Tutorials [11-16-2016]
Here's a way to do it, though I'm not sure how else to do it.
ChiliWin.h
The lib I loaded in Main.cpp, though I don't think it matters where you load it.
Client.h
This basically says if _INC_WINDOWS is not #defined, then include ChiliWin.h. If it's already defined then ChiliWin.h won't be reincluded.
I think that's all the changes I made.
ChiliWin.h
Code: Select all
// Ws2tcpip.h includes WinSock2.h and WinSock2.h includes Windows.h, so only have to include Ws2tcpip instead of the other two.
#include <Ws2tcpip.h>
Client.h
Code: Select all
#ifndef _INC_WINDOWS
#include "ChiliWin.h"
#endif
I think that's all the changes I made.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: C++ Winsock Networking Tutorials [11-16-2016]
Oh, I take that back, I had to add
#undef min
#undef max
in Graphics.cpp and MainWindow.cpp
#undef min
#undef max
in Graphics.cpp and MainWindow.cpp
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com