CMake and D

Jan Allersma janallersma at gmail.com
Sat Aug 6 13:52:28 UTC 2022


I forgot that I have to add some DUB dependencies. So I have to 
use `dub` instead of `dmd`.
My strategy is to

1) Create a D function which will be called in C++.
2) Build a static library containing the D function (using `dub 
build`).
3) Build an executable file with CMake.

However, I get an `ld` error:

```
/usr/bin/ld: 
../libhello-sdl.a(app_1_144.o):(.text.d_dso_init[.data.d_dso_rec]+0x22): undefined reference to `_d_dso_registry'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/framework.dir/build.make:85: framework] 
Fout 1
make[1]: *** [CMakeFiles/Makefile2:76: 
CMakeFiles/framework.dir/all] Fout 2
make: *** [Makefile:84: all] Fout 2
```

I do not know what `_d_dso_registry` is. Therefore, I don't know 
how to solve this problem.


More information about the Digitalmars-d-learn mailing list