0

I am using codelite IDE on windows, in that when I was trying to compile socket program,

it shows: warning: ignoring #pragma comment [-Wunknown-pragmas]

for include "WinSock2.h" #pragma comment(lib,"ws2_32.lib")

dxr
  • 29
  • 1
  • 8

1 Answers1

0

First, some clarifications: codelite is not a compiler but an IDE It uses toolchains (GNU, VC etc)

So when you are saying that "winsock library is not identified by codelite IDE" you actually means: the compiler warns about #pragma

Since you do not provide additional information here (such as the build log, the compiler you are using, codelite version etc) I will take a guess here and would say that you are mixingg the GNU toolchain with VC headers - try to use the WinAPI that comes with MinGW instead.

Looking at the WinSock2.h that comes with GCC for Windows I see only this pragma:

#pragma GCC system_header

Also, .lib libraries are meant to be used by VC but not by GCC

Eran

Eran
  • 2,310
  • 1
  • 13
  • 13
  • Thank you Eran and yes...that problem solved, I added -lws2_32 in linker and it works. – dxr Sep 18 '13 at 06:03