Re: Compilation problems with GDC/GCC

2017-04-15 Thread DRex via Digitalmars-d-learn
On Saturday, 15 April 2017 at 13:08:29 UTC, DRex wrote: On Saturday, 15 April 2017 at 13:02:43 UTC, DRex wrote: On Saturday, 15 April 2017 at 12:45:47 UTC, DRex wrote: Update to the Update, I fixed the lib failing to open by copying it to the location of my sources, and setting the ld to

Re: Compilation problems with GDC/GCC

2017-04-15 Thread DRex via Digitalmars-d-learn
On Saturday, 15 April 2017 at 13:02:43 UTC, DRex wrote: On Saturday, 15 April 2017 at 12:45:47 UTC, DRex wrote: Update to the Update, I fixed the lib failing to open by copying it to the location of my sources, and setting the ld to use libraries in that folder, however I am still getting

Re: Compilation problems with GDC/GCC

2017-04-15 Thread DRex via Digitalmars-d-learn
On Saturday, 15 April 2017 at 12:45:47 UTC, DRex wrote: On Friday, 14 April 2017 at 18:00:22 UTC, Johannes Pfau wrote: Am Fri, 14 Apr 2017 13:03:22 + schrieb DRex : GDC should generally only need to link to -lgdruntime (and -lgphobos if you need it). However, if

Re: Compilation problems with GDC/GCC

2017-04-15 Thread DRex via Digitalmars-d-learn
On Friday, 14 April 2017 at 18:00:22 UTC, Johannes Pfau wrote: Am Fri, 14 Apr 2017 13:03:22 + schrieb DRex : GDC should generally only need to link to -lgdruntime (and -lgphobos if you need it). However, if you really link using ld you'll have to provide the C

Re: Compilation problems with GDC/GCC

2017-04-14 Thread DRex via Digitalmars-d-learn
On Friday, 14 April 2017 at 12:01:39 UTC, DRex wrote: the -r option redirects the linked object files into another object file, so the point being I can pass a D object and a C object to the linker and produce another object file. As for linking D files, do you mean passing the druntime

Re: Compilation problems with GDC/GCC

2017-04-14 Thread DRex via Digitalmars-d-learn
On Friday, 14 April 2017 at 11:51:54 UTC, Nicholas Wilson wrote: On Friday, 14 April 2017 at 11:32:57 UTC, DRex wrote: I have project which involves both C and D code. For reasons that are much too long to explain, I have to use GCC to compile the C code into object files (GDC to compile the

Compilation problems with GDC/GCC

2017-04-14 Thread DRex via Digitalmars-d-learn
I have project which involves both C and D code. For reasons that are much too long to explain, I have to use GCC to compile the C code into object files (GDC to compile the D code into object files) and then ld to link all the object files together. Now (unless I am missing something) ld

Re: Comparing Instances of Classes

2017-03-10 Thread DRex via Digitalmars-d-learn
On Friday, 10 March 2017 at 20:27:09 UTC, Meta wrote: On Friday, 10 March 2017 at 17:08:42 UTC, Whatsthisnow wrote: I guess i am just too used to the java way of x.equals(object) which at the source is exactly 'return this == object' Java would return false here too, though, if it actually

Re: Comparing Instances of Classes

2017-03-10 Thread DRex via Digitalmars-d-learn
On Friday, 10 March 2017 at 16:30:00 UTC, Adam D. Ruppe wrote: On Friday, 10 March 2017 at 16:22:18 UTC, DRex wrote: Error: function app.A.opEquals does not override any function, did you mean to override 'object.Object.opEquals'? Oh sorry, maybe I messed up the const. Try: override bool

Re: Comparing Instances of Classes

2017-03-10 Thread DRex via Digitalmars-d-learn
On Friday, 10 March 2017 at 16:13:21 UTC, Adam D. Ruppe wrote: On Friday, 10 March 2017 at 16:08:05 UTC, DRex wrote: Am I missing something here? Yeah, you need to implement a custom equality operator. class A { int member; override bool opEquals(const A rhs) { return

Comparing Instances of Classes

2017-03-10 Thread DRex via Digitalmars-d-learn
Hi, I am trying to compare two instances of a class. I created a test program to try this, but every method I use to compare the instances always returns false. this is my code to test comparison class A { this() { } } void main() { A a = new A(); A a2 = new A();

Linking C Headers to D

2017-01-11 Thread DRex via Digitalmars-d-learn
Hi, I am trying to link C and D (using GCC and GDC) and I am wondering (I could find no answers on google) if it is possible to compile C headers into object files and link them to D? I have a large code base of C headers and am not at a point where I can translate them all to D in one go,