digitalmars.D - Using C libraries
- Anders Runesson (11/11) May 30 2004 Hello.
- Stephan Wienczny (6/19) May 30 2004 That's correct, too.
- Walter (6/17) May 30 2004 i
Hello. I'm quite new to this "d"-thing, but it seems very interesting and i think i will use it, if i can clear a few things up. I have, based on the reading i have done, made the following assumptions, please correct me where i'm wrong. 1. D can link to C libraries. The standard c library have been wrapped(all functions redeclared with "extern (C) ...") in std.c.xxx-modules, so we can use them easily. 2. I cannot use functions from a c library unless i have declared them as extern (C) in my D source code. Structures in the c library that i want to use in my code have to be declared in my D code.
May 30 2004
Anders Runesson wrote:Hello. I'm quite new to this "d"-thing, but it seems very interesting and i think i will use it, if i can clear a few things up. I have, based on the reading i have done, made the following assumptions, please correct me where i'm wrong. 1. D can link to C libraries. The standard c library have been wrapped(all functions redeclared with "extern (C) ...") in std.c.xxx-modules, so we can use them easily.Correct.2. I cannot use functions from a c library unless i have declared them as extern (C) in my D source code. Structures in the c library that i want to use in my code have to be declared in my D code.That's correct, too. How should the compiler know about the functions and structures if you don't do that? Stephan
May 30 2004
"Anders Runesson" <arson disoriented.org> wrote in message news:c9d1qt$6es$1 digitaldaemon.com...Hello. I'm quite new to this "d"-thing, but it seems very interesting and i thinkiwill use it, if i can clear a few things up. I have, based on the readingihave done, made the following assumptions, please correct me where i'm wrong. 1. D can link to C libraries. The standard c library have been wrapped(all functions redeclared with "extern (C) ...") in std.c.xxx-modules, so wecanuse them easily. 2. I cannot use functions from a c library unless i have declared them as extern (C) in my D source code. Structures in the c library that i want to use in my code have to be declared in my D code.Both assumptions are correct.
May 30 2004