View previous topic :: View next topic |
Author |
Message |
nullgate
Joined: 26 Mar 2005 Posts: 3
|
Posted: Sat Mar 26, 2005 12:32 pm Post subject: [Help] Can I do this with D? |
|
|
I've been a Java guru for almost 4 years and hiding from real system programming all the time (It's not a problem since I make a living by writing Java code).
But I'm working on an open-source project, where Java just doesn't fit. Digital Mars D is my first choice, since it fits my philosophy in many ways. However, I need crypto algorithm like RSA/SHA-1, and more (which is available in Java and C/C++).
My question is "Can I use DMC to access available C/C++ crypto library (or open-source packages) and link it to D?"
I choose D because I'm used to OOP, and I need high level type system to prototype complex algorithm and data structure. I really don't like Java 'coz JVM hide too many things, while D gimme almost everything. |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Sat Mar 26, 2005 5:09 pm Post subject: |
|
|
I'm not sure about using DMC to link the existing libs. I believe it's not possible if the lib is in C++, but it definitely is if written in C. Just use DMD.
There may be some pure D crypto libs you could use.
Check here: http://svn.dsource.org/svn/projects/deimos/trunk/etc/crypto/hash/
BA |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Sat Mar 26, 2005 5:36 pm Post subject: |
|
|
If you have C/C++ source and you can compile it in DMC, you should be able to produce a .lib which can be linked into a D project. C++ classes can't be accessed directly, but functions should be accessible.
You also should also be able to use functions from a .DLL written in C/C++, but that's trickier than using a .lib (IMO). I'd recommend you try the .lib method first. |
|
Back to top |
|
|
nullgate
Joined: 26 Mar 2005 Posts: 3
|
Posted: Sat Mar 26, 2005 8:41 pm Post subject: I have the source |
|
|
But I don't have the right make file...
I'll try hard to make it work with DMC. |
|
Back to top |
|
|
nullgate
Joined: 26 Mar 2005 Posts: 3
|
Posted: Sat Mar 26, 2005 10:01 pm Post subject: how to deal with DLL? |
|
|
I have both source and DLL.
If I can't compile the source, I think it's possible to write DMC codes which I can use in DMD. |
|
Back to top |
|
|
|