How do you call a C++ function from a D program?
What commands should I use?
I’m trying to use dmd on Fedora.
How do you call a C++ function from a D program? What commands should
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simplest example I can think of, if you’re calling C functions:
If you’re using shared objects, you could so something like:
In this example, I linked with an SDL function. The
-Largument todmdallows you to pass arguments told, in this case-lSDLto link with SDL.D interface files (
.di) are described here.You should also take a look at htod.