referencing variables declared in an external c file

llee llee at goucher.edu
Wed Jul 2 12:48:38 PDT 2008


     I'm writing an application that is compiled against several object files that have been coded in c. These files define a variable named yyin that has the following prototype: FILE* yyin.
     I need to access this variable from my d code. I tried referencing the variable using the following statement: yyin = fopen (&fname [0], &fmode [0]);, but the compiler returned an error stating that yyin was undefined. I tried including the following extern (C) statement: extern (C) FILE* yyin;, but the linker complained that yyin was defined multiple times.\




More information about the Digitalmars-d mailing list