compile error in socketft.cpp

331 views
Skip to first unread message

mm

unread,
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

ka-bar

unread,
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.


ka-bar

--------------------------------------------------
From: "mm" <min...@gmail.com>
Sent: Tuesday, September 08, 2009 8:55 AM
To: "Crypto++ Users" <cryptop...@googlegroups.com>
Subject: compile error in socketft.cpp

mm

unread,
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 -

trungantran

unread,
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.

mm

unread,
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 -

mm

unread,
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

franj

unread,
Jan 28, 2010, 7:36:11 AM1/28/10
to cryptop...@googlegroups.com

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
> cryptopp-user...@googlegroups.com.
> More information about Crypto++ and this group is available at
> http://www.cryptopp.com.
> -~----------~----~----~----~------~----~------~--~---
>
>
>

--
View this message in context: http://old.nabble.com/compile-error-in-socketft.cpp-tp25338578p27355241.html
Sent from the Crypto++ Users mailing list archive at Nabble.com.

foad hergholi

unread,
Jan 7, 2014, 4:52:34 AM1/7/14
to cryptop...@googlegroups.com
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

unread,
May 9, 2014, 12:51:20 PM5/9/14
to cryptop...@googlegroups.com, mm, ka-bar_...@hotmail.com
Hi I have a similar issue here. Did you try this in Windows or Linux?

Vikas Patidar

unread,
Jun 13, 2014, 3:42:34 PM6/13/14
to cryptop...@googlegroups.com, min...@gmail.com, ka-bar_...@hotmail.com
Add "Ws2_32.lib" without quotes to Linker->input in your visual studio project.
Reply all
Reply to author
Forward
0 new messages