Re: __init unresolved external when using C library structs converted with dstep

2020-04-17 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-17 09:06:44 +, Dominikus Dittes Scherkl said: On Friday, 17 April 2020 at 08:59:41 UTC, Robert M. Münch wrote: How would that look like? myStruct ms = void; // ??? Exactly. Cool... never saw this / thought about it... will remember it, hopefully. -- Robert M. Münch http://w

Re: __init unresolved external when using C library structs converted with dstep

2020-04-17 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Friday, 17 April 2020 at 08:59:41 UTC, Robert M. Münch wrote: How would that look like? myStruct ms = void; // ??? Exactly.

Re: __init unresolved external when using C library structs converted with dstep

2020-04-17 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-16 18:33:51 +, Basile B. said: On Tuesday, 14 April 2020 at 17:51:58 UTC, Robert M. Münch wrote: I use a C libary and created D imports with dstep. It translates the C structs to D structs. When I now use them, everything compiles fine but I get an unresolved external error:

Re: __init unresolved external when using C library structs converted with dstep

2020-04-16 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 14 April 2020 at 17:51:58 UTC, Robert M. Münch wrote: I use a C libary and created D imports with dstep. It translates the C structs to D structs. When I now use them, everything compiles fine but I get an unresolved external error: WindowsApp1.obj : error LNK2019: unresolved ext

Re: __init unresolved external when using C library structs converted with dstep

2020-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/20 5:20 AM, Robert M. Münch wrote: On 2020-04-15 15:18:43 +, Steven Schveighoffer said: The difference is you are telling the compiler that it should generate any symbols for those types. If you just import them, then it's expecting something else to build those symbols. Maybe

Re: __init unresolved external when using C library structs converted with dstep

2020-04-16 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-15 15:18:43 +, Steven Schveighoffer said: The difference is you are telling the compiler that it should generate any symbols for those types. If you just import them, then it's expecting something else to build those symbols. Maybe I'm a bit confused, but that's quite different

Re: __init unresolved external when using C library structs converted with dstep

2020-04-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/15/20 8:38 AM, Robert M. Münch wrote: On 2020-04-14 18:44:55 +, Steven Schveighoffer said: On 4/14/20 2:29 PM, Robert M. Münch wrote: No. Is that the missing part? Probably. I think the compiler expects whatever is compiling the imported file to provide the symbol. If you aren't co

Re: __init unresolved external when using C library structs converted with dstep

2020-04-15 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-14 18:44:55 +, Steven Schveighoffer said: On 4/14/20 2:29 PM, Robert M. Münch wrote: Ah, ok. That's why the problem went (temporarly) away when I did a: myCstruct a = {0,0}; for example? I don't know what causes it to be emitted when. Sometimes it doesn't make a whole lot of

Re: __init unresolved external when using C library structs converted with dstep

2020-04-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/14/20 2:29 PM, Robert M. Münch wrote: On 2020-04-14 18:23:05 +, Steven Schveighoffer said: On 4/14/20 1:51 PM, Robert M. Münch wrote: I use a C libary and created D imports with dstep. It translates the C structs to D structs. When I now use them, everything compiles fine but I get

Re: __init unresolved external when using C library structs converted with dstep

2020-04-14 Thread Robert M. Münch via Digitalmars-d-learn
On 2020-04-14 18:23:05 +, Steven Schveighoffer said: On 4/14/20 1:51 PM, Robert M. Münch wrote: I use a C libary and created D imports with dstep. It translates the C structs to D structs. When I now use them, everything compiles fine but I get an unresolved external error: WindowsApp1

Re: __init unresolved external when using C library structs converted with dstep

2020-04-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/14/20 1:51 PM, Robert M. Münch wrote: I use a C libary and created D imports with dstep. It translates the C structs to D structs. When I now use them, everything compiles fine but I get an unresolved external error: WindowsApp1.obj : error LNK2019: unresolved external symbol "myCstruc

__init unresolved external when using C library structs converted with dstep

2020-04-14 Thread Robert M. Münch via Digitalmars-d-learn
I use a C libary and created D imports with dstep. It translates the C structs to D structs. When I now use them, everything compiles fine but I get an unresolved external error: WindowsApp1.obj : error LNK2019: unresolved external symbol "myCstruct.__init" (_D7myCStruct6__initZ) referenced