Okay, after looking at gtkd, I don't think this can be solved with
module constructors or swapping out to lazy initialization.
One way that might work however is to use a crt_constructor as that runs
before the D stuff. However it would now hard code your program to your
system. Over all my su
code:
```d
auto req = new ApplyContact();
data.fromProtobuf!ApplyContact(req);
```
protobuf:
```d
class ApplyContact
{
@Proto(1) string fromId = protoDefaultValue!string;
@Proto(2) string toId = protoDefaultValue!string;
@Proto(3) string message = protoDefaultValue!string;
@Proto
I was using a different version of dmd. Problem solved. thank you
On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
wrote:
Thanks Jonathan
On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
wrote:
look like?
Types can have static members.
Basically what it comes down to is that outside of immutable
data, pure functions only have access to their arguments and to
what they can access via their arguments (be it by getti
Hi,
I just encountered a strange link error: I have a `struct` type
`My_struct`, the program compiles fine, but at link time, it
errors out:
undefined reference to _My_struct__xtoHashFNbNeKxSQBlQBoQBiZm
undefined reference to _My_struct__xopEqualsMxFKxSQBlQBoQBiZb
looks like it treats My_str
On Monday, 16 October 2023 at 10:23:54 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Okay, after looking at gtkd, I don't think this can be solved
with module constructors or swapping out to lazy initialization.
One way that might work however is to use a crt_constructor as
that runs before th
On Monday, 16 October 2023 at 18:28:52 UTC, dan wrote:
(Now, i still think that when module initialization order is
not forced, it should be something a programmer or systems
integrator can choose, but i don't want to be too greedy.)
Thanks again for your help!!
dan
I changed the subject l
On Monday, 16 October 2023 at 18:20:27 UTC, mw wrote:
Hi,
I just encountered a strange link error: I have a `struct` type
`My_struct`, the program compiles fine, but at link time, it
errors out:
undefined reference to _My_struct__xtoHashFNbNeKxSQBlQBoQBiZm
undefined reference to _My_struct__
On Monday, 16 October 2023 at 19:36:07 UTC, Imperatorn wrote:
On Monday, 16 October 2023 at 18:20:27 UTC, mw wrote:
Hi,
I just encountered a strange link error: I have a `struct`
type `My_struct`, the program compiles fine, but at link time,
it errors out:
undefined reference to _My_struct_
On Monday, 16 October 2023 at 18:57:45 UTC, bachmeier wrote:
On Monday, 16 October 2023 at 18:28:52 UTC, dan wrote:
(Now, i still think that when module initialization order is
not forced, it should be something a programmer or systems
integrator can choose, but i don't want to be too greedy.)
On Monday, 16 October 2023 at 20:06:02 UTC, ryuukk_ wrote:
On Monday, 16 October 2023 at 19:36:07 UTC, Imperatorn wrote:
On Monday, 16 October 2023 at 18:20:27 UTC, mw wrote:
[...]
Show your code here on in Discord
https://discord.gg/wKTvGNpc
No, show your code here on the forum, don't nee
It's very hard to isolate the problem. I have comment out that
piece part of code for now (non-essential part of my program):
comment out where the struct is used, not the struct definition.
Anyway, I will try some time later.
On Monday, 16 October 2023 at 21:20:39 UTC, mw wrote:
It's very hard to isolate the problem. I have comment out that
piece part of code for now (non-essential part of my program):
comment out where the struct is used, not the struct definition.
Anyway, I will try some time later.
BTW, the st
xtoHash and xopEquals are generated by the compiler automatically.
Curiously those two symbol names are not demangling.
Given this, I suspect the best thing to do is file a bug report with ldc
with the code that generated the linker error.
On Tuesday, 17 October 2023 at 00:44:17 UTC, Richard (Rikki)
Andrew Cattermole wrote:
xtoHash and xopEquals are generated by the compiler
automatically.
Curiously those two symbol names are not demangling.
Given this, I suspect the best thing to do is file a bug report
with ldc with the code
On Tuesday, 17 October 2023 at 00:44:17 UTC, Richard (Rikki)
Andrew Cattermole wrote:
xtoHash and xopEquals are generated by the compiler
automatically.
These two are for `class`, but shouldn't be generated for
`struct`, right?
They are for structs as well.
On 17/10/2023 1:58 PM, mw wrote:
Oh the <_My_struct> part is my simplification, it is mangled as
something like : _D6..<_My_struct>..__xtoHashFNbNeKxSQBlQBoQBiZm
When dealing with linker errors, please do not simplify, it can make
problems unsolvable.
On Tuesday, 17 October 2023 at 01:11:13 UTC, Richard (Rikki)
Andrew Cattermole wrote:
They are for structs as well.
Ah?! I use quite a few struts, but I never have provided such two
methods.
On Tuesday, 17 October 2023 at 01:14:04 UTC, Richard (Rikki)
Andrew Cattermole wrote:
On 17/10/2023 1:58 PM, mw wrote:
Oh the <_My_struct> part is my simplification, it is mangled
as something like :
_D6..<_My_struct>..__xtoHashFNbNeKxSQBlQBoQBiZm
When dealing with linker errors, please do no
On 17/10/2023 2:15 PM, mw wrote:
On Tuesday, 17 October 2023 at 01:11:13 UTC, Richard (Rikki) Andrew
Cattermole wrote:
They are for structs as well.
Ah?! I use quite a few struts, but I never have provided such two methods.
Indeed, they are generated by the compiler, not user provided.
They
On 17/10/2023 2:17 PM, mw wrote:
It's just my own module and type name, nothing special or interesting.
Doesn't matter.
Because I now can't demangle it and figure out what its trying to find
without doing that by hand. Every character in a symbol name is
significant, you can't remove some of
On Tuesday, 17 October 2023 at 01:54:12 UTC, Richard (Rikki)
Andrew Cattermole wrote:
On 17/10/2023 2:15 PM, mw wrote:
On Tuesday, 17 October 2023 at 01:11:13 UTC, Richard (Rikki)
Andrew Cattermole wrote:
They are for structs as well.
Ah?! I use quite a few struts, but I never have provided s
On 17/10/2023 4:18 PM, mw wrote:
Is string basic types? as I showed one earlier Foo {one string and two
ints}, my other struct only has double and long, it also has the same
link errors about toHash and opEquals.
string is not a basic type, its a slice, which means pointer.
Hi all!
I want readable mixin.
I want pass variable to string.
I want string with named args.
Like this:
```D
enum JMP_ADDR_R = "RAX";
mixin( format!"asm {
jmp [JMP_ADDR_R];
}"( JMP_ADDR_R ));// IT NOT WORK
```
Not this:
```D
enum JMP_ADDR_R = "RAX";
mixin( form
26 matches
Mail list logo