Jump to content

Big Problem!!!!(methodz Urgent Help Required)

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
bodhi2016

bodhi2016

    Newbie

  • Members
  • PipPip
  • 29 posts
Guys as you know i started with my winsock programming.The first and foremost thing that one should do before winsock programming is link the project with winsock32 library.I opened the folder
D:\Dev-Cpp\lib
I was really shocked to see that all the files had extension .a like
libwsock32.a. Shouldn't they have .h extension.
Please take a look at the screenshot i have attached .Is it an accident that all .h extension has been changed .a or all the files in the lib folder are to have .a extension.And should i link my winsock programme with this "libwsock32.a " file

Attached Files


Edited by bodhi2016, 19 June 2008 - 05:36 AM.


#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
No, it's not an accident. libwsock32.a and all the other files with the .a-extension are static libraries. A file with a .h-extension is header/include-files.

A static library (do not confuse with a dynamic library with a .dll-extension on Windows and .so-extension on Linux) is a pre-compiled "package" which contains implementations of function, and other stuff. Header/include-files do not implement functions, they do only declare them by name.

So don't worry, everything's fine and dandy.

#3
MeTh0Dz

MeTh0Dz

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,119 posts
Yeah it's all good. The library in Dev-Cpp is just using the lib as a prefix and the .a extension. So go ahead and link that "libwsock32.a" and you will be just fine. Make sure to also....

#include <windows.h>


#4
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
There's maybe some functionality you want in windows.h, like MeTh0Dz showed, but most of the (if not all) functionality for socket/network-programming is in winsock2.h (or for the older version, winsock.h).

#5
MeTh0Dz

MeTh0Dz

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,119 posts
Winsock.h is included in windows.h, which is why I said that.

#6
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Yes, but not winsock2.h as far as I know. I may be wrong, I haven't used Windows for almost a year now.

#7
MeTh0Dz

MeTh0Dz

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,119 posts
That is correct, winsock.h is in windows.h.