pragma(lib,...)

Lionello Lunesu lio at remove.lunesu.com
Mon Mar 13 07:32:11 PST 2006


Hi,

I'm having some problems with "pragma(lib,..)". I have a 1 module D program, 
main.d, to test a socket connection. It imports std.socket, whcih used to 
work just fine, without the need to provide a lib. With DMD 0.149 however 
(don't know when this issue was introduced) it won't find the winsock 
imports:

 D:\llunesu>dmd main
 C:\dmd\bin\..\..\dm\bin\link.exe main,,,user32+kernel32/noi;
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 C:\dmd\bin\..\lib\phobos.lib(socket)
  Error 42: Symbol Undefined _getprotobyname at 4
<and many more>

When I provide the lib name on the command line it works fine:

 D:\llunesu>dmd main WSOCK32.LIB
 C:\dmd\bin\..\..\dm\bin\link.exe main,,,WSOCK32.LIB+user32+kernel32/noi;

But when I specifiy pragma(lib,"WSOCK32.LIB") (which works just fine in 
other projects) I get:

 D:\llunesu>dmd main
 C:\dmd\bin\..\..\dm\bin\link.exe main,,,user32+kernel32/noi;
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

OPTLINK : Warning 23: No Stack
main.obj(main)
 Error 42: Symbol Undefined __init_11TypeInfo_Aa
main.obj(main)
 Error 42: Symbol Undefined __nullext
main.obj(main)
 Error 42: Symbol Undefined __ModuleInfo_3std5stdio
main.obj(main)
 Error 42: Symbol Undefined __ModuleInfo_3std7cstream
main.obj(main)
 Error 42: Symbol Undefined __ModuleInfo_3std6socket
OPTLINK : Warning 134: No Start Address
--- errorlevel 5


Any idea?

L. 





More information about the Digitalmars-d-learn mailing list