Having trouble with Linker Error 2001

BenShums's Avatar, Join Date: Jan 2008
Newbie Member
Hi,
I'm having trouble getting this linker bug to go away.
I have 2 files: Socket.cpp and Socket.h. I know that these files are legitamite because my professor gave them to me during last semester.

When I remove socket.cpp, everything compiles just fine. But with Socket.cpp, I get these errors.

__________________________________________________ _____________
Error 16 error LNK2001: unresolved external symbol ___WSAFDIsSet@8 socket.obj
Error 11 error LNK2001: unresolved external symbol __imp__accept@12 socket.obj
Error 9 error LNK2001: unresolved external symbol __imp__bind@12 socket.obj
Error 4 error LNK2001: unresolved external symbol __imp__closesocket@4 socket.obj
Error 14 error LNK2001: unresolved external symbol __imp__connect@12 socket.obj
Error 13 error LNK2001: unresolved external symbol __imp__gethostbyname@4 socket.obj
Error 8 error LNK2001: unresolved external symbol __imp__htons@4 socket.obj
Error 5 error LNK2001: unresolved external symbol __imp__ioctlsocket@12 socket.obj
Error 10 error LNK2001: unresolved external symbol __imp__listen@8 socket.obj
Error 6 error LNK2001: unresolved external symbol __imp__recv@16 socket.obj
Error 15 error LNK2001: unresolved external symbol __imp__select@20 socket.obj
Error 7 error LNK2001: unresolved external symbol __imp__send@16 socket.obj
Error 3 error LNK2001: unresolved external symbol __imp__socket@12 socket.obj
Error 2 error LNK2001: unresolved external symbol __imp__WSACleanup@0 socket.obj
Error 12 error LNK2001: unresolved external symbol __imp__WSAGetLastError@0 socket.obj
Error 1 error LNK2001: unresolved external symbol __imp__WSAStartup@8 socket.obj
Error 17 fatal error LNK1120: 16 unresolved externals C:\Users\Ben\Desktop\Documents\Visual Studio 2008\Projects\ConnectionDLL2\Release\ConnectionDLL 2.dll
-----------------------------------------------------------------------------------------------------

Socket.h includes
#include <WinSocket.h>
#include <string>
#include "ConnectionDLL2.h"


Socket.cpp includes...
#include "stdafx.h"
--> Which includes
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <windows.h>
#include <iostream>
#include <string>
#include <list>
#include <map>
#include <algorithm>
#include <queue>
#include <process.h>
#include <strstream>
using namespace std;
#include "Socket.h"


Also note that I'm using Visual C++ 2008 (which is very similar to VC2005)

Thanks

~Ben S.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You don't have the necessary libs included for compiling the file socket.cpp
0
BenShums's Avatar, Join Date: Jan 2008
Newbie Member
thaaaaaaaaaaaaaaaaaaaaank you.
Thank you thank you thank you thank. And thanks. I've been working on this stupid problem for hours. Thank you.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder