Re: Why does calling a struct constructor generate linker errors when using Better C?

2017-12-23 Thread Stijn via Digitalmars-d-learn
On Sunday, 24 December 2017 at 01:29:56 UTC, rikki cattermole wrote: Although maybe you ought to start out with regular D. -betterC is really there for those who want D but can't have druntime. They should already know D pretty well. I'm using -betterC on purpose, doing bare-metal

Re: Why does calling a struct constructor generate linker errors when using Better C?

2017-12-23 Thread rikki cattermole via Digitalmars-d-learn
On 24/12/2017 1:25 AM, Stijn wrote: On Sunday, 24 December 2017 at 01:21:53 UTC, rikki cattermole wrote: On 24/12/2017 1:20 AM, Stijn wrote: [...] new uses GC. It has nothing to do with structs. Oh I see, simply removing 'new' solves the problem. I've a C# background, so I hadn't thought

Re: Why does calling a struct constructor generate linker errors when using Better C?

2017-12-23 Thread Stijn via Digitalmars-d-learn
On Sunday, 24 December 2017 at 01:21:53 UTC, rikki cattermole wrote: On 24/12/2017 1:20 AM, Stijn wrote: [...] new uses GC. It has nothing to do with structs. Oh I see, simply removing 'new' solves the problem. I've a C# background, so I hadn't thought of doing that. Thanks!

Why does calling a struct constructor generate linker errors when using Better C?

2017-12-23 Thread Stijn via Digitalmars-d-learn
https://dlang.org/spec/betterc.html doesn't mention struct constructors not working, but I'm getting linker errors when trying to call a struct constructor. Consider the following program betterc.d struct foo { } extern(C) void main() { auto bar = new foo(); }

Re: Why does calling a struct constructor generate linker errors when using Better C?

2017-12-23 Thread rikki cattermole via Digitalmars-d-learn
On 24/12/2017 1:20 AM, Stijn wrote: https://dlang.org/spec/betterc.html doesn't mention struct constructors not working, but I'm getting linker errors when trying to call a struct constructor. Consider the following program betterc.d     struct foo     {     }     extern(C) void main()