compile error in socketft.cpp

Skip to first unread message


Sep 7, 2009, 8:55:48 PM9/7/09
to Crypto++ Users
Hi everyone

I am a new member to this group so firstly thnaks to evryone

I am trying to compile the crypto++ on omnet++ in windows xp.
first I got an error in rijndael.cpp which said :'alloca' was not
declared in this scope therefore I add #include <malloc.h> at the
begining of rijndael.cpp and try to compile again but I got 6 errors
in socketft.cpp as follows:

undefined reference to `_WSAEnumNetworkEvents@12'
undefined reference to `_WSAEventSelect@12'
undefined reference to `_WSAGetOverlappedResult@20'
undefined reference to `_WSAGetOverlappedResult@20'
undefined reference to `_WSARecv@28'
undefined reference to `_WSASend@28'

can you please help me what is wrong?

thanks in advance


Sep 7, 2009, 9:54:21 PM9/7/09
to mm, Crypto++ Users
Try this:
#pragma comment(lib,"Ws2_32.lib")
Add it to your file.


From: "mm" <>
Sent: Tuesday, September 08, 2009 8:55 AM
To: "Crypto++ Users" <>
Subject: compile error in socketft.cpp


Sep 7, 2009, 11:03:51 PM9/7/09
to Crypto++ Users
Hi thank you for your reply

I add #pragma comment(lib,"Ws2_32.lib") at the begining of the
socketft.h but nothing changed and still I have the errors. can you
please tell me what is wrong?

thank you
> > thanks in advance- Hide quoted text -
> - Show quoted text -


Sep 9, 2009, 12:39:54 PM9/9/09
to Crypto++ Users
If you are using a MSVC-compatible compiler(Borland, Intel ...), use
"#pragma comment("ws2_32.lib")".
If you are using GCC(MinGW/Cygwin) or a compiler that doesnt support
auto-linking, you need to fix the linker command. For example, in case
of GCC, you have to add "-lws2_32" to the linker command.


Sep 9, 2009, 8:09:54 PM9/9/09
to Crypto++ Users
Hi thank you very much for the reply

I use Mingw but I dont know how I should do what you said about adding
"-lws2_32" to the linker command. can you please tell me where and how
I should add this "-lws2_32" ?

Thanks alot
> > > - Show quoted text -- Hide quoted text -


Sep 9, 2009, 11:24:19 PM9/9/09
to Crypto++ Users
Hi dear trungantran

I did it and it compiled now thank you very very much


Jan 28, 2010, 7:36:11 AM1/28/10

Hi mm-29,

I have a similar problem. Could you please tell me where and how to add this
"-lws2_32" ?

Thanks in advance,

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the "Crypto++
> Users" Google Group.
> To unsubscribe, send an email to
> More information about Crypto++ and this group is available at
> -~----------~----~----~----~------~----~------~--~---

View this message in context:
Sent from the Crypto++ Users mailing list archive at

foad hergholi

Jan 7, 2014, 4:52:34 AM1/7/14
hi every one.
i need to import cryptopp to omnet, but i dont know how add it
please help me about it?
i run omnet on windows 7 and i try to import cryptopp to omnet froom this post :

Chibueze Ogah

May 9, 2014, 12:51:20 PM5/9/14
to, mm,
Hi I have a similar issue here. Did you try this in Windows or Linux?

Vikas Patidar

Jun 13, 2014, 3:42:34 PM6/13/14
Add "Ws2_32.lib" without quotes to Linker->input in your visual studio project.
Reply all
Reply to author
0 new messages