Re: LNK2019 error in the C++ interface

2021-06-16 Thread dokutoku via Digitalmars-d-learn
On Thursday, 10 June 2021 at 15:19:27 UTC, kinke wrote: Confirmed: https://issues.dlang.org/show_bug.cgi?id=22014 Thank you for the bug report. I'm glad I couldn't handle it myself. The only thing that bothers me is that there is no sign of this problem being fixed. I fear that this may

Re: Creating a static library

2021-06-12 Thread dokutoku via Digitalmars-d-learn
On Friday, 11 June 2021 at 10:40:27 UTC, Mike Brown wrote: https://dlang.org/articles/dll-linux.html mentions the GC and linking requirements. I am happy to not use the GC for this library, what is the best way to turn this off for the entire library? I think you can add the betterC flag

Re: LNK2019 error in the C++ interface

2021-06-10 Thread dokutoku via Digitalmars-d-learn
It's been a while since then, but the problem with the structure has been solved. The reason seems to be that the structure name defined in core.sys.windows.windef was not tagRECT. I was able to get it to compile by adding a custom definition as follows ```d extern (C) struct tagRECT {

LNK2019 error in the C++ interface

2020-09-03 Thread dokutoku via Digitalmars-d-learn
I tried to use a function from a library written in C++ in D. I've been trying to use it in D. But I got an error in LNK2019 and the build failed. So I created a simple static library as follows and built it. ```cpp #pragma once #include namespace static_test { void str_test(LPCSTR

The effect of ref

2019-11-21 Thread dokutoku via Digitalmars-d-learn
Is there a difference in the execution speed and stability when executing the program by rewriting the parameter of the function argument like this? ```d void test1 (int * X) { // some processing } void test2 (ref int X) { // some processing } ```

How to get the address of an instance of a class

2019-09-25 Thread dokutoku via Digitalmars-d-learn
I wrote the following code to get the address of a class instance, but it doesn't work. Please let me know if there is a way to write it to work properly. private import std; ``` class C { C* this_pointer() { return this; } } void main() { C Z =

Re: DLL creation fails with undefined symbol error

2019-04-26 Thread dokutoku via Digitalmars-d-learn
On Friday, 26 April 2019 at 12:37:46 UTC, evilrat wrote: On Friday, 26 April 2019 at 05:08:32 UTC, dokutoku wrote: I tried to build a DLL in a Windows 64bit environment. It works well if the compiler is DMD, but in the case of LDC, the build fails with a large number of undefined symbol

DLL creation fails with undefined symbol error

2019-04-25 Thread dokutoku via Digitalmars-d-learn
I tried to build a DLL in a Windows 64bit environment. It works well if the compiler is DMD, but in the case of LDC, the build fails with a large number of undefined symbol errors. Is this a DUB or LDC bug? Or do I have to specify some additional arguments to the command?

Re: Loading of wasm function fails

2019-04-22 Thread dokutoku via Digitalmars-d-learn
On Monday, 22 April 2019 at 13:05:03 UTC, Adam D. Ruppe wrote: On Monday, 22 April 2019 at 10:36:23 UTC, dokutoku wrote: How can I solve this problem? I played with this last week, try adding -L--export-dynamic to your ldc command line to build. I mentioned it briefly on my blog last week

Loading of wasm function fails

2019-04-22 Thread dokutoku via Digitalmars-d-learn
I try to use wasm with LDC, but I can not load wasm functions with the following message even if I write it the same as the "Generating WebAssembly with LDC" page on wiki TypeError: exports.add is not a function How can I solve this problem?

Re: Invalid string literal in ASM

2018-10-03 Thread dokutoku via Digitalmars-d-learn
On Monday, 1 October 2018 at 10:45:25 UTC, Basile B. wrote: On Monday, 1 October 2018 at 09:24:47 UTC, Basile B. wrote: On Monday, 1 October 2018 at 08:14:07 UTC, dokutoku wrote: I get a compiler error when I try to put non-ASCII characters in a string literal in the inline assembler. Is

Invalid string literal in ASM

2018-10-01 Thread dokutoku via Digitalmars-d-learn
I get a compiler error when I try to put non-ASCII characters in a string literal in the inline assembler. Is this part of the specifications?