Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi everyone,
I need help about this situation.

I need to create a socket (client/server) in a 64bit application on Visual C++ 2010 in a windows 7 64bit system.

As example, my tutor link me this class

http://cs.baylor.edu/~donahoo/practical/CSockets/practical/

But it's too old, and seems made for only 32 bit application.

I've tried to compile an example of that available (TCPEchoClient.cpp) but visual C++ give me these errors:

1>------ Inizio compilazione: Progetto: sockt, Configurazione: Debug Win32 ------<br />
1>Compilazione avviata 19/03/2014 08:22:42.<br />
1>InitializeBuildStatus:<br />
1>  Aggiornamento timestamp di "Debug\sockt.unsuccessfulbuild".<br />
1>ClCompile:<br />
1>  Tutti gli output sono aggiornati.<br />
1>ManifestResourceCompile:<br />
1>  Tutti gli output sono aggiornati.<br />
1>TCPEchoClient.obj : error LNK2019: riferimento al simbolo esterno "public: int __thiscall CommunicatingSocket::recv(void *,int)" (?recv@CommunicatingSocket@@QAEHPAXH@Z) non risolto nella funzione _main<br />
1>TCPEchoClient.obj : error LNK2019: riferimento al simbolo esterno "public: void __thiscall CommunicatingSocket::send(void const *,int)" (?send@CommunicatingSocket@@QAEXPBXH@Z) non risolto nella funzione _main<br />
1>TCPEchoClient.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall TCPSocket::TCPSocket(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned short)" (??0TCPSocket@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@G@Z) non risolto nella funzione _main<br />
1>TCPEchoClient.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall Socket::~Socket(void)" (??1Socket@@QAE@XZ) non risolto nella funzione "public: __thiscall CommunicatingSocket::~CommunicatingSocket(void)" (??1CommunicatingSocket@@QAE@XZ)<br />
1>C:\OPENCV\Test\miei\provefunzioni\sockt\Debug\sockt.exe : fatal error LNK1120: 4 esterni non risolti<br />
1><br />
1>Compilazione NON RIUSCITA.


Now, I think it's about the library that this class need, and I've found on google that wsock32.lib it's replaced on windows 7 with a dll, ws2_32.dll, that contain the 32 and 64 bit version of that lib.

I've found it on

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\x64

but, even I set this path for "additional library" the program don't compile.

How can I use this class on my 64bit project?

Or, someone can tell me a simple mode to create a socket client/server in a 64bit project of visual c++ 2010 on Windows 7 64bit??

Thanks in advance.
Posted

1 solution

Class CommunicatingSocket is not part of Windows libraries. Instead, it is defined in in PracticalSocket.cpp and ParacticalSocket.h (you have to add these files to your project).
 
Share this answer
 
Comments
Domus1919 19-Mar-14 4:21am    
I've add that files to project, and the situation it's the same: a lot of errors and don't compile...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900