Re: Just starting with D (linking with C++)

2017-10-28 Thread sivakon via Digitalmars-d-learn
On Saturday, 28 October 2017 at 02:20:42 UTC, codephantom wrote: On Friday, 27 October 2017 at 17:14:20 UTC, sivakon wrote: I want to use C++ libraries for machine learning and deep learning. How do I add C++ libraries to my d code. on FreeBSD, I use: for C static binding:

Re: Just starting with D (linking with C++)

2017-10-27 Thread codephantom via Digitalmars-d-learn
On Friday, 27 October 2017 at 17:14:20 UTC, sivakon wrote: I want to use C++ libraries for machine learning and deep learning. How do I add C++ libraries to my d code. on FreeBSD, I use: for C static binding: -- clang -c sample.c dmd -L-lc foo.d sample.o or ldc -L-lc

Re: Just starting with D (linking with C++)

2017-10-27 Thread Joakim via Digitalmars-d-learn
On Friday, 27 October 2017 at 17:43:08 UTC, sivakon wrote: On Friday, 27 October 2017 at 17:21:39 UTC, Joakim wrote: This should work: dmd foo.d Sample.o Just like the C examples from the D blog: https://dlang.org/blog/2017/10/25/dmd-windows-and-c/ Just used this! Got this error!

Re: Just starting with D (linking with C++)

2017-10-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/27/17 1:43 PM, sivakon wrote: On Friday, 27 October 2017 at 17:21:39 UTC, Joakim wrote: This should work: dmd foo.d Sample.o Just like the C examples from the D blog: https://dlang.org/blog/2017/10/25/dmd-windows-and-c/ Just used this! Got this error! sample.o: In function

Re: Just starting with D (linking with C++)

2017-10-27 Thread sivakon via Digitalmars-d-learn
On Friday, 27 October 2017 at 17:21:39 UTC, Joakim wrote: This should work: dmd foo.d Sample.o Just like the C examples from the D blog: https://dlang.org/blog/2017/10/25/dmd-windows-and-c/ Just used this! Got this error! sample.o: In function `foo(int, int, int)':

Re: Just starting with D (linking with C++)

2017-10-27 Thread Joakim via Digitalmars-d-learn
On Friday, 27 October 2017 at 17:14:20 UTC, sivakon wrote: Hi, Just started to work with D. Great language. I want to use C++ libraries for machine learning and deep learning. How do I add C++ libraries to my d code. For example, //sample.cpp #include using namespace std; int foo(int i,

Just starting with D (linking with C++)

2017-10-27 Thread sivakon via Digitalmars-d-learn
Hi, Just started to work with D. Great language. I want to use C++ libraries for machine learning and deep learning. How do I add C++ libraries to my d code. For example, //sample.cpp #include using namespace std; int foo(int i, int j, int k) { cout << "i = " << i << endl; cout