|
The CLI thing is Command Line Input version of the compiler (old school, sorry). I am specifficaly not using .Net.
All I really want to do is be able to compile and execute all the progrms first. Then I want to add some additional code on both client and server.
I have the MC VC ++ complier took ket 2003 and I have Visual Studio .Net.
Tha challen is the file structure that you get with the download.zip files is not usabel.
If you go to this site and download your files you would see wht I am trying to explain. They will not compile as is.
Regards
Mike
|
|
|
|
|
I am glad you are using VC6.0 too. Yes, I did download the zip from this site and I did unzip it and it creates two directories, one for the client and one for the server, and it compiled fine.
I also read this article again: all you need is clearly written in the article, I guess you just need a little patience? Also, other folks can do it without problem. try it again, build the two projects (one for the client, one for the server), follow the instructions here, it should work.
|
|
|
|
|
Thanks again.
Help me understand what you mean exatly by projects. I have not been using any project support from the compiler and have been trying to compile each program in a stand alone mode. Are you creating a "project" and then adding the source to the project. Since i did not see any porject files I assume this was the way to go.
I will re-read the doc.
Thank you for your patience.
Mike
|
|
|
|
|
oh, I finally understand what you meant. I think the thing you need to do is to use microsoft visual C++ 6.0, and it has an IDE (intergrated development environment), in this IDE, you can create a "project" and do the compile and debug etc.
The very top of this article has a link, "Download source - 40 Kb", click on this link to download the source code, it is a zip file and when you unzip it, it creates two directories, one is for the client, one is for the server.
Start the IDE from VC6.0, use the "new" menu to create a "project", for example, for the server first, name it whatever you want to, and add all the files from in the server directory into this project and start to compile, it should be compiling with no problems.
Create another "project" in the VC6.0 IDE for the client, and add all the files from the client directory into this project and compile. you should be fine.
|
|
|
|
|
I have jumped to the Visal Studion .Net 2005 Beta.
I built a project for the client, set the C++ option to no procompiled headers, win32 app, and did a build soluion. Received Error C1083 file not found for #include files. The downloaded directroy and folder structure does not match the #include statements in the code.
Do I creatre the folders and copy the code or change the #include statements in all the source?
#include "..\mySocket\mySocket.h"
#include "..\myLog\myLog.h"
#include "..\myException\myException.h"
#include "..\myHostInfo\myHostInfo.h"
Also received several warning messages.
Thanks
Mike
He is the output form the Build solution:
Compiling...
CS_Client.cpp
myClient.cpp
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\myclient.cpp(1) : fatal error C1083: Cannot open include file: '..\mySocket\mySocket.h': No such file or directory
myException.cpp
myHostInfo.cpp
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\myhostinfo.cpp(2) : fatal error C1083: Cannot open include file: '..\myLog\myLog.h': No such file or directory
myLog.cpp
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(100) : warning C4996: 'gmtime' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\time.inl(87) : see declaration of 'gmtime'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(114) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(115) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(118) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(140) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
mySocket.cpp
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mysocket.h(4) : fatal error C1083: Cannot open include file: '../myHostInfo/myHostInfo.h': No such file or directory
Generating Code...
|
|
|
|
|
Mike,
I did the following, as you can see:
#include "..\mySocket\mySocket.h"
#include "..\myLog\myLog.h"
#include "..\myException\myException.h"
#include "..\myHostInfo\myHostInfo.h"
so I kinda of hard-coded the path for each of the .h file - you can put the .h files anywhere you want, but you do have to change the path here to reflect the changes you have made. the easiest thing to do is to put all the .h files together with the .cpp files in the same directory, and then change the above code into the following:
#include "mySocket.h"
#include "myLog.h"
#include "myException.h"
#include "myHostInfo.h"
the compiler will then easily find all the .h files.
|
|
|
|
|
Hi Liyang,
I have been offline for a while due to hurricane Rita (i live in the NW Houston area).
I got by the compile #include issues only to run into a linker problem which i am sure is easy to resolve. I compiled this using VS VC++ beta2005 and VS VC++ 6.0 and saw the same error messages. I have included beta2005 output in this message.
Are there "additional library" that I need to include?
Build Log Rebuild started: Project: CS_Client, Configuration: Debug|Win32
Command Lines Creating temporary file "c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\RSP0000051986427192.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /GS- /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP /prefast ..\..\mySocket.cpp
..\..\myLog.cpp
..\..\myHostInfo.cpp
..\..\myException.cpp
..\..\myClient.cpp
.\CS_Client.cpp
]
Creating command line "cl.exe @c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\RSP0000051986427192.rsp /nologo /errorReport:prompt"
Creating temporary file "c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\RSP0000061986427192.rsp" with contents
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /GS- /Yc"stdafx.h" /Fp"Debug\CS_Client.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP /prefast .\stdafx.cpp
]
Creating command line "cl.exe @c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\RSP0000061986427192.rsp /nologo /errorReport:prompt"
Creating command line "rc.exe /d "_UNICODE" /d "UNICODE" /fo"Debug/CS_Client.res" .\CS_Client.rc"
Creating temporary file "c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\TMP0000071986427192.tmp" with contents
[
1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\CS_Client.exe.embed.manifest"
]
Creating command line "rc.exe /fo".\Debug\CS_Client.exe.embed.manifest.res" c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\TMP0000071986427192.tmp"
Creating temporary file "c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\RSP0000081986427192.rsp" with contents
[
/OUT:"Debug\CS_Client.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\CS_Client.exe.intermediate.manifest" /DEBUG /PDB:"c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\CS_Client.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\CS_Client.obj"
".\Debug\myClient.obj"
".\Debug\myException.obj"
".\Debug\myHostInfo.obj"
".\Debug\myLog.obj"
".\Debug\mySocket.obj"
".\Debug\stdafx.obj"
".\Debug\CS_Client.res"
".\Debug\CS_Client.exe.embed.manifest.res"
]
Creating command line "link.exe @c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\RSP0000081986427192.rsp /NOLOGO /ERRORREPORT:PROMPT"
Output Window Compiling...
cl : Command line warning D9035 : option 'prefast' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'analyze' instead of 'prefast'
stdafx.cpp
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(708) : warning C6054: string '_Source' may not be zero-terminated: Lines: 705, 708
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(717) : warning C6054: string '_Source' may not be zero-terminated: Lines: 714, 717
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(728) : warning C6054: string '_Source' may not be zero-terminated: Lines: 725, 728
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(728) : warning C6054: string '_Destination' may not be zero-terminated: Lines: 725, 728
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(737) : warning C6054: string '_Source' may not be zero-terminated: Lines: 734, 737
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(737) : warning C6054: string '_Destination' may not be zero-terminated: Lines: 734, 737
Compiling...
cl : Command line warning D9035 : option 'prefast' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'analyze' instead of 'prefast'
CS_Client.cpp
myClient.cpp
myException.cpp
myHostInfo.cpp
myLog.cpp
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(100) : warning C4996: 'gmtime' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\time.inl(87) : see declaration of 'gmtime'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(114) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(115) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(118) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mylog.cpp(140) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
mySocket.cpp
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mysocket.cpp(14) : warning C4244: '=' : conversion from 'SOCKET' to 'int', possible loss of data
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mysocket.cpp(1080) : warning C4244: '=' : conversion from 'SOCKET' to 'int', possible loss of data
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mysocket.cpp(1191) : warning C4996: 'sprintf' was declared deprecated
c:\program files\microsoft visual studio 8\vc\include\stdio.h(317) : see declaration of 'sprintf'
c:\source\singleservermultipleclient_src_2\singleservermultipleclientsrc\client\mysocket.cpp(1198) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
Processing...
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1353) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=char,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1359) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=wchar_t,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6237: ( && ) is always zero. is never evaluated and may have side effects
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'int std::basic_filebuf<_Elem,_Traits>::pbackfail(int)'
with
[
_Elem=char,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(549) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6239: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'unsigned short std::basic_filebuf<_Elem,_Traits>::pbackfail(unsigned short)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(551) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(471) : warning C6240: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(459) : while compiling class template member function 'void std::basic_filebuf<_Elem,_Traits>::_Init(_iobuf *,std::basic_filebuf<_Elem,_Traits>::_Initfl)'
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(107) : warning C6011: dereferencing NULL pointer '_Myptr': Lines: 93, 96, 97, 107
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(88) : while compiling class template member function 'const char &std::_String_const_iterator<_Elem,_Traits,_Alloc>::operator *(void) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(912) : see reference to class template instantiation 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(911) : while compiling class template member function 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::append(const _Elem *)'
with
[
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(2057) : see reference to class template instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1353) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=char,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1359) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=wchar_t,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6237: ( && ) is always zero. is never evaluated and may have side effects
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'int std::basic_filebuf<_Elem,_Traits>::pbackfail(int)'
with
[
_Elem=char,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(549) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6239: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'unsigned short std::basic_filebuf<_Elem,_Traits>::pbackfail(unsigned short)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(551) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(471) : warning C6240: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(459) : while compiling class template member function 'void std::basic_filebuf<_Elem,_Traits>::_Init(_iobuf *,std::basic_filebuf<_Elem,_Traits>::_Initfl)'
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(107) : warning C6011: dereferencing NULL pointer '_Myptr': Lines: 93, 96, 97, 107
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(88) : while compiling class template member function 'const char &std::_String_const_iterator<_Elem,_Traits,_Alloc>::operator *(void) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(340) : see reference to class template instantiation 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(332) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,std::_Bool &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1353) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=char,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1359) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=wchar_t,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6237: ( && ) is always zero. is never evaluated and may have side effects
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'int std::basic_filebuf<_Elem,_Traits>::pbackfail(int)'
with
[
_Elem=char,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(549) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6239: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'unsigned short std::basic_filebuf<_Elem,_Traits>::pbackfail(unsigned short)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(551) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(471) : warning C6240: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(459) : while compiling class template member function 'void std::basic_filebuf<_Elem,_Traits>::_Init(_iobuf *,std::basic_filebuf<_Elem,_Traits>::_Initfl)'
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(107) : warning C6011: dereferencing NULL pointer '_Myptr': Lines: 93, 96, 97, 107
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(88) : while compiling class template member function 'const char &std::_String_const_iterator<_Elem,_Traits,_Alloc>::operator *(void) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(912) : see reference to class template instantiation 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(911) : while compiling class template member function 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::append(const _Elem *)'
with
[
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(2057) : see reference to class template instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits,
_Ax=std::allocator
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1353) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=char,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1359) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=wchar_t,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1353) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=char,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(459) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 452, 456, 457, 458, 459
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(455) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,__int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1359) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
with
[
_Elem=wchar_t,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(479) : warning C6054: string '*argument 2' may not be zero-terminated: Lines: 472, 476, 477, 478, 479
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(475) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,unsigned __int64 &) const'
with
[
_Elem=wchar_t,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6237: ( && ) is always zero. is never evaluated and may have side effects
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'int std::basic_filebuf<_Elem,_Traits>::pbackfail(int)'
with
[
_Elem=char,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(549) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(299) : warning C6239: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(285) : while compiling class template member function 'unsigned short std::basic_filebuf<_Elem,_Traits>::pbackfail(unsigned short)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(551) : see reference to class template instantiation 'std::basic_filebuf<_Elem,_Traits>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(471) : warning C6240: ( && ) always evaluates to the result of . Did you intend to use the bitwise-and operator?
C:\Program Files\Microsoft Visual Studio 8\VC\include\fstream(459) : while compiling class template member function 'void std::basic_filebuf<_Elem,_Traits>::_Init(_iobuf *,std::basic_filebuf<_Elem,_Traits>::_Initfl)'
with
[
_Elem=char,
_Traits=std::char_traits
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(107) : warning C6011: dereferencing NULL pointer '_Myptr': Lines: 93, 96, 97, 107
C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(88) : while compiling class template member function 'const char &std::_String_const_iterator<_Elem,_Traits,_Alloc>::operator *(void) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(340) : see reference to class template instantiation 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits,
_Alloc=std::allocator
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(332) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,std::_Bool &) const'
with
[
_Elem=char,
_Traits=std::char_traits,
_InIt=std::istreambuf_iterator>
]
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(708) : warning C6054: string '_Source' may not be zero-terminated: Lines: 705, 708
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(717) : warning C6054: string '_Source' may not be zero-terminated: Lines: 714, 717
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(728) : warning C6054: string '_Source' may not be zero-terminated: Lines: 725, 728
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(728) : warning C6054: string '_Destination' may not be zero-terminated: Lines: 725, 728
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(737) : warning C6054: string '_Source' may not be zero-terminated: Lines: 734, 737
c:\Program Files\Microsoft Visual Studio 8\VC\include\tchar.h(737) : warning C6054: string '_Destination' may not be zero-terminated: Lines: 734, 737
Generating Code...
Compiling resources...
Compiling manifest to resources...
Linking...
myClient.obj : error LNK2019: unresolved external symbol __imp__inet_ntoa@4 referenced in function "public: char * __thiscall myHostInfo::getHostIPAddress(void)" (?getHostIPAddress@myHostInfo@@QAEPADXZ)
mySocket.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4
myHostInfo.obj : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function "public: __thiscall myHostInfo::myHostInfo(void)" (??0myHostInfo@@QAE@XZ)
myHostInfo.obj : error LNK2019: unresolved external symbol __imp__gethostname@8 referenced in function "public: __thiscall myHostInfo::myHostInfo(void)" (??0myHostInfo@@QAE@XZ)
myHostInfo.obj : error LNK2019: unresolved external symbol __imp__gethostbyaddr@12 referenced in function "public: __thiscall myHostInfo::myHostInfo(class std::basic_string,class std::allocator > &,enum hostType)" (??0myHostInfo@@QAE@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4hostType@@@Z)
myHostInfo.obj : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "public: __thiscall myHostInfo::myHostInfo(class std::basic_string,class std::allocator > &,enum hostType)" (??0myHostInfo@@QAE@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4hostType@@@Z)
mySocket.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
myHostInfo.obj : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function "private: void __thiscall myHostInfo::detectErrorGethostbyname(int *,class std::basic_string,class std::allocator > &)" (?detectErrorGethostbyname@myHostInfo@@AAEXPAHAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
mySocket.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
mySocket.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function __catch$??0mySocket@@QAE@H@Z$0
mySocket.obj : error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function __catch$??0mySocket@@QAE@H@Z$0
mySocket.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "public: __thiscall mySocket::mySocket(int)" (??0mySocket@@QAE@H@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function "public: virtual __thiscall mySocket::~mySocket(void)" (??1mySocket@@UAE@XZ)
mySocket.obj : error LNK2019: unresolved external symbol __imp__setsockopt@20 referenced in function "public: void __thiscall mySocket::setDebug(int)" (?setDebug@mySocket@@QAEXH@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__ioctlsocket@12 referenced in function "public: void __thiscall mySocket::setSocketBlocking(int)" (?setSocketBlocking@mySocket@@QAEXH@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__getsockopt@20 referenced in function "public: int __thiscall mySocket::getDebug(void)" (?getDebug@mySocket@@QAEHXZ)
mySocket.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function "public: virtual __thiscall myTcpSocket::~myTcpSocket(void)" (??1myTcpSocket@@UAE@XZ)
mySocket.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "public: static void __cdecl myTcpSocket::initialize(void)" (?initialize@myTcpSocket@@SAXXZ)
mySocket.obj : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function "public: void __thiscall myTcpSocket::bindSocket(void)" (?bindSocket@myTcpSocket@@QAEXXZ)
mySocket.obj : error LNK2019: unresolved external symbol __imp__connect@12 referenced in function "public: virtual void __thiscall myTcpSocket::connectToServer(class std::basic_string,class std::allocator > &,enum hostType)" (?connectToServer@myTcpSocket@@UAEXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4hostType@@@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function "public: class myTcpSocket * __thiscall myTcpSocket::acceptClient(class std::basic_string,class std::allocator > &)" (?acceptClient@myTcpSocket@@QAEPAV1@AAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function "public: void __thiscall myTcpSocket::listenToClient(int)" (?listenToClient@myTcpSocket@@QAEXH@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function "public: int __thiscall myTcpSocket::sendMessage(class std::basic_string,class std::allocator > &)" (?sendMessage@myTcpSocket@@QAEHAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
mySocket.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function "private: int __thiscall myTcpSocket::XPrecieveMessage(class std::basic_string,class std::allocator > &)" (?XPrecieveMessage@myTcpSocket@@AAEHAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
Debug\CS_Client.exe : fatal error LNK1120: 21 unresolved externals
Results Build log was saved at "file://c:\Source\singleServerMultipleClient_Src_2\singleServerMultipleClientSrc\client\CS_Client\CS_Client\Debug\BuildLog.htm"
CS_Client - 25 error(s), 61 warning(s)
|
|
|
|
|
Mike,
Hope you are doing well now! man, a tough year for everyone.
Anyway, if you can, please use Visual C++ 6.0, that is the one I used when doing this project.
for your problem, first make sure the following (I am assuming you are using visual studio 6.0) and I am assuming you built a project for your client (and certainly for your server too): at the menu bar, find the menu item "project", click it, goto "properties", in the popup box, on the leftside select the Linker folder then select Input. on the right side, select the top textbox "additional dependencies" and type in "ws2_32.lib".
If you still have the link problem, for example, the it complains that a function foo() cannot be found, then first you need to know which file (.cpp file) contains foo()? for example, foo.cpp contains foo(), then, you need to make sure foo.cpp IS included in your project.
HTH,
liyang
|
|
|
|
|
Just one more pooint of clarification.
I am using the free MS VC++ compiler that does not have any of the .Net type support. It is command line only.
I did create a Bloodshed compile environment and created a project and was able to get further utill I received the error below. The "clientInfo" did not resolve in MySocket.cpp.
BTW thius is a different download and has all the files including winserver.cpp in the same folder.
// Get the host name given the address
char *sAddress = inet_ntoa((struct in_addr)clientAddress.sin_addr);
myHostInfo clientInfo(string(sAddress),ADDRESS);
char* hostName = clientInfo.getHostName();
clientHost += string(hostName);
1076 C:\Compile\CSProject\mySocket.cpp no matching function for call to `myHostInfo::myHostInfo(std::string, hostType)'
Thanks again. I agree this should not be this hard.
|
|
|
|
|
no matter the socket is in blocking/non-blocking mode, partial receive happens,
for example when you do recv for the header which is 6 bytes, you might get 2 bytes and need other read to get it all. the code does not handle it.
|
|
|
|
|
I remembered I did this check and handled it in the code, but let me check again.
thanks!
|
|
|
|
|
hello there,
great code! i just have some problems compiling it with vc++ 6.0. i'm getting the following errors with the client side:
myclient.cpp(99) : fatal error C1010: unexpected end of file while looking for precompiled header directive
myexception.cpp(26) : fatal error C1010: unexpected end of file while looking for precompiled header directive
myhostinfo.cpp(180) : fatal error C1010: unexpected end of file while looking for precompiled header directive
mylog.cpp(143) : fatal error C1010: unexpected end of file while looking for precompiled header directive
mysocket.cpp(1414) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.
Client.exe - 5 error(s), 0 warning(s)
and similar errors for the server side.
any suggestions??
cheers.
|
|
|
|
|
seems like the .h files have problems: check to see you include all the .h files correct, and there is no extra ";" at the end of the .h files, no extra ";" thing at un-necessary places.
HTH,
liyang
|
|
|
|
|
Yeah , when i compiled this code i confronted such this kind of errrors. i just corrected the #include "..\mySocket\mySocket.h" to #include "mySocket.h" then compiled successfully.
|
|
|
|
|
Does this code work if compiled in MSA?
|
|
|
|
|
check your personal email.
|
|
|
|
|
there is a long list of errors as shown below. how do i solve it
--------------------Configuration: myserver - Win32 Debug--------------------
Compiling...
winSeverForMultipleClient.cpp
d:\program files\microsoft sdk\include\winsock2.h(109) : error C2011: 'fd_set' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(144) : warning C4005: 'FD_SET' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(88) : see previous definition of 'FD_SET'
d:\program files\microsoft sdk\include\winsock2.h(153) : error C2011: 'timeval' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(209) : error C2011: 'hostent' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(222) : error C2011: 'netent' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(229) : error C2011: 'servent' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(241) : error C2011: 'protoent' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(397) : error C2011: 'sockaddr_in' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(407) : error C2011: 'WSAData' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(467) : warning C4005: 'SO_DONTLINGER' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(411) : see previous definition of 'SO_DONTLINGER'
d:\program files\microsoft sdk\include\winsock2.h(524) : warning C4005: 'AF_IPX' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(469) : see previous definition of 'AF_IPX'
d:\program files\microsoft sdk\include\winsock2.h(552) : warning C4005: 'AF_MAX' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(488) : see previous definition of 'AF_MAX'
d:\program files\microsoft sdk\include\winsock2.h(558) : error C2011: 'sockaddr' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(598) : error C2011: 'sockproto' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(637) : error C2011: 'linger' : 'struct' type redefinition
d:\program files\microsoft sdk\include\winsock2.h(650) : warning C4005: 'SOMAXCONN' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(553) : see previous definition of 'SOMAXCONN'
d:\program files\microsoft sdk\include\winsock2.h(675) : warning C4005: 'FD_READ' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(571) : see previous definition of 'FD_READ'
d:\program files\microsoft sdk\include\winsock2.h(678) : warning C4005: 'FD_WRITE' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(572) : see previous definition of 'FD_WRITE'
d:\program files\microsoft sdk\include\winsock2.h(681) : warning C4005: 'FD_OOB' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(573) : see previous definition of 'FD_OOB'
d:\program files\microsoft sdk\include\winsock2.h(684) : warning C4005: 'FD_ACCEPT' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(574) : see previous definition of 'FD_ACCEPT'
d:\program files\microsoft sdk\include\winsock2.h(687) : warning C4005: 'FD_CONNECT' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(575) : see previous definition of 'FD_CONNECT'
d:\program files\microsoft sdk\include\winsock2.h(690) : warning C4005: 'FD_CLOSE' : macro redefinition
d:\program files\microsoft sdk\include\winsock.h(576) : see previous definition of 'FD_CLOSE'
d:\program files\microsoft sdk\include\winsock2.h(1622) : error C2375: 'accept' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(744) : see declaration of 'accept'
d:\program files\microsoft sdk\include\winsock2.h(1643) : error C2375: 'bind' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(749) : see declaration of 'bind'
d:\program files\microsoft sdk\include\winsock2.h(1662) : error C2375: 'closesocket' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(754) : see declaration of 'closesocket'
d:\program files\microsoft sdk\include\winsock2.h(1681) : error C2375: 'connect' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(756) : see declaration of 'connect'
d:\program files\microsoft sdk\include\winsock2.h(1702) : error C2375: 'ioctlsocket' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(761) : see declaration of 'ioctlsocket'
d:\program files\microsoft sdk\include\winsock2.h(1723) : error C2375: 'getpeername' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(766) : see declaration of 'getpeername'
d:\program files\microsoft sdk\include\winsock2.h(1744) : error C2375: 'getsockname' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(771) : see declaration of 'getsockname'
d:\program files\microsoft sdk\include\winsock2.h(1767) : error C2375: 'getsockopt' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(776) : see declaration of 'getsockopt'
d:\program files\microsoft sdk\include\winsock2.h(1788) : error C2375: 'htonl' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(783) : see declaration of 'htonl'
d:\program files\microsoft sdk\include\winsock2.h(1805) : error C2375: 'htons' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(785) : see declaration of 'htons'
d:\program files\microsoft sdk\include\winsock2.h(1822) : error C2375: 'inet_addr' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(787) : see declaration of 'inet_addr'
d:\program files\microsoft sdk\include\winsock2.h(1839) : error C2375: 'inet_ntoa' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(789) : see declaration of 'inet_ntoa'
d:\program files\microsoft sdk\include\winsock2.h(1857) : error C2375: 'listen' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(791) : see declaration of 'listen'
d:\program files\microsoft sdk\include\winsock2.h(1875) : error C2375: 'ntohl' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(795) : see declaration of 'ntohl'
d:\program files\microsoft sdk\include\winsock2.h(1892) : error C2375: 'ntohs' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(797) : see declaration of 'ntohs'
d:\program files\microsoft sdk\include\winsock2.h(1912) : error C2375: 'recv' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(799) : see declaration of 'recv'
d:\program files\microsoft sdk\include\winsock2.h(1937) : error C2375: 'recvfrom' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(805) : see declaration of 'recvfrom'
d:\program files\microsoft sdk\include\winsock2.h(1963) : error C2375: 'select' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(813) : see declaration of 'select'
d:\program files\microsoft sdk\include\winsock2.h(1987) : error C2375: 'send' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(820) : see declaration of 'send'
d:\program files\microsoft sdk\include\winsock2.h(2012) : error C2375: 'sendto' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(826) : see declaration of 'sendto'
d:\program files\microsoft sdk\include\winsock2.h(2038) : error C2375: 'setsockopt' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(834) : see declaration of 'setsockopt'
d:\program files\microsoft sdk\include\winsock2.h(2060) : error C2375: 'shutdown' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(841) : see declaration of 'shutdown'
d:\program files\microsoft sdk\include\winsock2.h(2080) : error C2375: 'socket' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(845) : see declaration of 'socket'
d:\program files\microsoft sdk\include\winsock2.h(2103) : error C2375: 'gethostbyaddr' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(852) : see declaration of 'gethostbyaddr'
d:\program files\microsoft sdk\include\winsock2.h(2122) : error C2375: 'gethostbyname' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(857) : see declaration of 'gethostbyname'
d:\program files\microsoft sdk\include\winsock2.h(2140) : error C2375: 'gethostname' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(859) : see declaration of 'gethostname'
d:\program files\microsoft sdk\include\winsock2.h(2159) : error C2375: 'getservbyport' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(863) : see declaration of 'getservbyport'
d:\program files\microsoft sdk\include\winsock2.h(2178) : error C2375: 'getservbyname' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(867) : see declaration of 'getservbyname'
d:\program files\microsoft sdk\include\winsock2.h(2196) : error C2375: 'getprotobynumber' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(871) : see declaration of 'getprotobynumber'
d:\program files\microsoft sdk\include\winsock2.h(2213) : error C2375: 'getprotobyname' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(873) : see declaration of 'getprotobyname'
d:\program files\microsoft sdk\include\winsock2.h(2233) : error C2375: 'WSAStartup' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(877) : see declaration of 'WSAStartup'
d:\program files\microsoft sdk\include\winsock2.h(2251) : error C2375: 'WSACleanup' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(881) : see declaration of 'WSACleanup'
d:\program files\microsoft sdk\include\winsock2.h(2268) : error C2375: 'WSASetLastError' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(883) : see declaration of 'WSASetLastError'
d:\program files\microsoft sdk\include\winsock2.h(2285) : error C2375: 'WSAGetLastError' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(885) : see declaration of 'WSAGetLastError'
d:\program files\microsoft sdk\include\winsock2.h(2302) : error C2375: 'WSAIsBlocking' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(887) : see declaration of 'WSAIsBlocking'
d:\program files\microsoft sdk\include\winsock2.h(2319) : error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(889) : see declaration of 'WSAUnhookBlockingHook'
d:\program files\microsoft sdk\include\winsock2.h(2336) : error C2375: 'WSASetBlockingHook' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(891) : see declaration of 'WSASetBlockingHook'
d:\program files\microsoft sdk\include\winsock2.h(2353) : error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(893) : see declaration of 'WSACancelBlockingCall'
d:\program files\microsoft sdk\include\winsock2.h(2375) : error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(895) : see declaration of 'WSAAsyncGetServByName'
d:\program files\microsoft sdk\include\winsock2.h(2402) : error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(903) : see declaration of 'WSAAsyncGetServByPort'
d:\program files\microsoft sdk\include\winsock2.h(2428) : error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(911) : see declaration of 'WSAAsyncGetProtoByName'
d:\program files\microsoft sdk\include\winsock2.h(2453) : error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(918) : see declaration of 'WSAAsyncGetProtoByNumber'
d:\program files\microsoft sdk\include\winsock2.h(2478) : error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(925) : see declaration of 'WSAAsyncGetHostByName'
d:\program files\microsoft sdk\include\winsock2.h(2505) : error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(932) : see declaration of 'WSAAsyncGetHostByAddr'
d:\program files\microsoft sdk\include\winsock2.h(2528) : error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(941) : see declaration of 'WSACancelAsyncRequest'
d:\program files\microsoft sdk\include\winsock2.h(2548) : error C2375: 'WSAAsyncSelect' : redefinition; different linkage
d:\program files\microsoft sdk\include\winsock.h(943) : see declaration of 'WSAAsyncSelect'
Error executing cl.exe.
myserver.exe - 57 error(s), 11 warning(s)
|
|
|
|
|
sorry for the long message but these are the errors....linking ws2_32.lib is done
can you help
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(109): error C2011: 'fd_set' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(144): warning C4005: 'FD_SET' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(153): error C2011: 'timeval' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(209): error C2011: 'hostent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(222): error C2011: 'netent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(229): error C2011: 'servent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(241): error C2011: 'protoent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(397): error C2011: 'sockaddr_in' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(407): error C2011: 'WSAData' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(467): warning C4005: 'SO_DONTLINGER' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(524): warning C4005: 'AF_IPX' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(552): warning C4005: 'AF_MAX' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(558): error C2011: 'sockaddr' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(598): error C2011: 'sockproto' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(637): error C2011: 'linger' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(650): warning C4005: 'SOMAXCONN' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(675): warning C4005: 'FD_READ' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(678): warning C4005: 'FD_WRITE' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(681): warning C4005: 'FD_OOB' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(684): warning C4005: 'FD_ACCEPT' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(687): warning C4005: 'FD_CONNECT' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(690): warning C4005: 'FD_CLOSE' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1622): error C2375: 'accept' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1643): error C2375: 'bind' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1662): error C2375: 'closesocket' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1681): error C2375: 'connect' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1702): error C2375: 'ioctlsocket' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1723): error C2375: 'getpeername' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1744): error C2375: 'getsockname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1767): error C2375: 'getsockopt' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1788): error C2375: 'htonl' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1805): error C2375: 'htons' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1822): error C2375: 'inet_addr' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1839): error C2375: 'inet_ntoa' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1857): error C2375: 'listen' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1875): error C2375: 'ntohl' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1892): error C2375: 'ntohs' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1912): error C2375: 'recv' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1937): error C2375: 'recvfrom' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1963): error C2375: 'select' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1987): error C2375: 'send' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2012): error C2375: 'sendto' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2038): error C2375: 'setsockopt' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2060): error C2375: 'shutdown' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2080): error C2375: 'socket' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2103): error C2375: 'gethostbyaddr' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2122): error C2375: 'gethostbyname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2140): error C2375: 'gethostname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2159): error C2375: 'getservbyport' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2178): error C2375: 'getservbyname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2196): error C2375: 'getprotobynumber' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2213): error C2375: 'getprotobyname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2233): error C2375: 'WSAStartup' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2251): error C2375: 'WSACleanup' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2268): error C2375: 'WSASetLastError' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2285): error C2375: 'WSAGetLastError' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2302): error C2375: 'WSAIsBlocking' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2319): error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2336): error C2375: 'WSASetBlockingHook' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2353): error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2375): error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2402): error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2428): error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2453): error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2478): error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2505): error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2528): error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2548): error C2375: 'WSAAsyncSelect' : redefinition; different linkage
waseem
|
|
|
|
|
The problem, I think, is because windows.h includes winsock.h. If you add #define WIN32_LEAN_AND_MEAN before #include "myEvent.h" in winServerForMultipleClient.cpp (i.e. the first line) then the code compiles without errors.
|
|
|
|
|
hi,
has anyone implemented broadcasting from server to all the clients.
waseem
|
|
|
|
|
well, one solution could be like this.
server S has several clients, C0, C1, C2, .... the question is how can S broadcast something to all the Cs.
pretend S now is the client, and all the Cs are servers. S wants to send message to several different servers, namely, C0, C1, and so on so forth. S has to know the IP of all C's, and make sure that every C is listening to a particular port number that S also knows. Now you can just let S do the following:
1. S contacts each C to make a connection;
2. after that, S sends the same message to each very C.
HTH,
liyang
|
|
|
|
|
hi,
I tried compiling the code in VC++ 7.0, client had no errors and compiled nicely but in server i got lot of errors and none of the errors are from .cpp or .h. when i double click on the error i see winsock2.h popup. Since it is in "include" region i didnt touch anything. can you help me out of this. I have even linked the required .lib to the linker.
waseem
|
|
|
|
|
I was using VC6.0 when I was doing this project, and after that, I pretty much switched to VS.NET, so I am not sure about VC7.0, sounded like the winsock2.h is obseleted or they have a new name for that. I am not sure.
let me do a little research too.
|
|
|
|
|
Hi
What can be done if you expect hundreds of clients at the same time? Opening a thread for every client is not very effective in such a case. Is there a technic to deal with clients in one thread?
thx
Stefan
|
|
|
|
|
the question is the same as the follows:
when a breaking news happens, everybody tries to access CNN to take a look, so in a short period of time, the hit rates on CNN.com is extremely high. How does CNN (or other similar site) handle this?
The solution taken by most people is to provide "mirror" sites: CNN will have several servers, they are all exactly the same, when there are lots of users (threads), each server will handle some of them.
Good question. except for the above, I am not aware of any other solutions so far.
|
|
|
|
|