Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] C++ Errors

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Wed Apr 30, 2008 10:33 pm    Post subject: [Help] C++ Errors Reply with quote

Im working on a project in C++ which has to do with Winsock2. I get the following errors:

Code:
Packet.obj : error LNK2001: unresolved external symbol __imp__closesocket@4
Packet.obj : error LNK2001: unresolved external symbol __imp__send@16
Packet.obj : error LNK2001: unresolved external symbol __imp__accept@12
Packet.obj : error LNK2001: unresolved external symbol __imp__listen@8
Packet.obj : error LNK2001: unresolved external symbol __imp__bind@12
Packet.obj : error LNK2001: unresolved external symbol __imp__htons@4
Packet.obj : error LNK2001: unresolved external symbol __imp__socket@12
Packet.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0
Packet.obj : error LNK2001: unresolved external symbol __imp__WSAGetLastError@0
Packet.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8


But im not sure what to do to fix them, can anyone help lead the way? Confused
Back to top
View user's profile Send private message AIM Address MSN Messenger
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed Apr 30, 2008 11:11 pm    Post subject: Reply with quote

missing lib?
________
justin bieber fan


Last edited by Bizarro on Tue Feb 01, 2011 11:59 am; edited 1 time in total
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Wed Apr 30, 2008 11:11 pm    Post subject: Reply with quote

I'm not sure which lib im missing.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Wed Apr 30, 2008 11:17 pm    Post subject: Reply with quote

did u include Winsock2.h?

Header Declared in Winsock2.h.

Library Use Ws2_32.lib.

DLL Requires Ws2_32.dll.
________
Atlantic


Last edited by Bizarro on Tue Feb 01, 2011 11:59 am; edited 1 time in total
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Apr 30, 2008 11:59 pm    Post subject: Reply with quote

Bizarro wrote:
Library Use Ws2_32.lib


ding ding

Link against this.

for future reference, MSDN will tell you exactly what you need, so be sure to use it when in doubt.
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu May 01, 2008 1:37 am    Post subject: Reply with quote

#pragma comment( lib, "ws2_32.lib" )
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Thu May 01, 2008 9:24 am    Post subject: Reply with quote

Also make sure you read up about Winsock includes and libs, they must be included before you include windows.h

Some more info on the headers:
http://msdn.microsoft.com/en-us/library/ms737629(VS.85).aspx

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Thu May 01, 2008 5:35 pm    Post subject: Reply with quote

NOZ THANK YOU!!
Back to top
View user's profile Send private message AIM Address MSN Messenger
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Fri May 02, 2008 8:38 am    Post subject: Reply with quote

Wiccaan wrote:
Also make sure you read up about Winsock includes and libs, they must be included before you include windows.h

Some more info on the headers:
http://msdn.microsoft.com/en-us/library/ms737629(VS.85).aspx


Lol that pissed me off when I was first writing detours for winsock, I was declaring includes for the libraries and headers after windows.h =\ hundreds of errors Very Happy Figured it out after a short while though.

Come to think of it, I never finished the project.. I think it was crashing every time I injected, ended up making a proxy instead. Will have to revive that project and get it working. Laughing
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Fri May 02, 2008 9:50 am    Post subject: Reply with quote

Yea when I was doing some random projects with it I ran into the issue too, looked up the funcs and found that article and was like "wow... so many errors for such a stupid reason.." Figured they would add a #ifdef block at the top of the winsock file to determine if windows.h was included already and just die on that. But no...
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites