www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++.windows.32-bits - socket lib file

↑ ↓ ← john.mcloughlin rocketmail.com writes:
Hello,
I am trying to write a simple socket program.
I am new to DMC.
In MS IDE I used to add wsock32.lib in the project settings.
From what I can gather in DM I need to have a lib file to import fn calls from
winsock.dll (I found this on my 2000 machine).
I wrote this lib file in Notepad (maybe naive!!) and tried:
link /implib winsock.lib c:\winnt\system32\winsock.dll
I got corruption error 138 - I think the format or something is wrong.
Any help is appreciated.
Thanks...

LIBRARY winsock
EXETYPE NT
SUBSYSTEM CONSOLE

EXPORTS
_WSAStartup 8                 = WSAStartup                          ;
WSAStartup
_connect 12                   = connect                             ;
connect
_htons 4                      = htons                               ;
htons
_inet_addr 4                  = _inet_addr                          ;
inet_addr
_socket 12                    = socket                              ;
socket
_WSACleanup 0                 = WSACleanup                          ;
WSACleanup
Jul 02 2002
↑ ↓ "Walter" <walter digitalmars.com> writes:
Use implib to create .lib files from .def files, not the linker. -Walter

<john.mcloughlin rocketmail.com> wrote in message
news:afsm0b$2ebb$1 digitaldaemon.com...
 Hello,
 I am trying to write a simple socket program.
 I am new to DMC.
 In MS IDE I used to add wsock32.lib in the project settings.
 From what I can gather in DM I need to have a lib file to import fn calls

 winsock.dll (I found this on my 2000 machine).
 I wrote this lib file in Notepad (maybe naive!!) and tried:
 link /implib winsock.lib c:\winnt\system32\winsock.dll
 I got corruption error 138 - I think the format or something is wrong.
 Any help is appreciated.
 Thanks...

 LIBRARY winsock
 EXETYPE NT
 SUBSYSTEM CONSOLE

 EXPORTS
 _WSAStartup 8                 = WSAStartup                          ;
 WSAStartup
 _connect 12                   = connect                             ;
 connect
 _htons 4                      = htons                               ;
 htons
 _inet_addr 4                  = _inet_addr                          ;
 inet_addr
 _socket 12                    = socket                              ;
 socket
 _WSACleanup 0                 = WSACleanup                          ;
 WSACleanup

Jul 02 2002
↑ ↓ → john.mcloughlin rocketmail.com writes:
Thanks...
I heard about this implib.exe, I guess its on the CD?
I couldn't find it in the download I got.
Maybe I looked in the wrong place.
John

In article <aftukn$mtf$1 digitaldaemon.com>, Walter says...
Use implib to create .lib files from .def files, not the linker. -Walter

<john.mcloughlin rocketmail.com> wrote in message
news:afsm0b$2ebb$1 digitaldaemon.com...
 Hello,
 I am trying to write a simple socket program.
 I am new to DMC.
 In MS IDE I used to add wsock32.lib in the project settings.
 From what I can gather in DM I need to have a lib file to import fn calls

 winsock.dll (I found this on my 2000 machine).
 I wrote this lib file in Notepad (maybe naive!!) and tried:
 link /implib winsock.lib c:\winnt\system32\winsock.dll
 I got corruption error 138 - I think the format or something is wrong.
 Any help is appreciated.
 Thanks...

 LIBRARY winsock
 EXETYPE NT
 SUBSYSTEM CONSOLE

 EXPORTS
 _WSAStartup 8                 = WSAStartup                          ;
 WSAStartup
 _connect 12                   = connect                             ;
 connect
 _htons 4                      = htons                               ;
 htons
 _inet_addr 4                  = _inet_addr                          ;
 inet_addr
 _socket 12                    = socket                              ;
 socket
 _WSACleanup 0                 = WSACleanup                          ;
 WSACleanup


Jul 08 2002