snn.lib , setmode and linker errors

Charlie charlie.fats at gmail.com
Tue Mar 20 17:53:28 PDT 2007


Hi,

Im trying to write a CGI lib in D, and it requires stdin be put in 
binaru mode for windows, which is done with setmode(), declared in io.h 
and is in snn.lib.  Here is the code:

import std.c.stdio;

void main ()
{

   version ( Windows )
     {
       int O_BINARY = 0x8000;
       extern ( C ) int setmode(int,int);
       setmode(stdin._file ,O_BINARY);
     }

}

And the error:

stest.obj(stest)
  Error 42: Symbol Undefined __D5stest4mainFZv7setmodeMUiiZi
--- errorlevel 1

Im explictly linking to snn.lib ( is that needed ? ) , why is it still 
undefined ?

Thanks,
Charlie


More information about the Digitalmars-d-learn mailing list