Making a D library for a C executable
Jan Allersma
janallersma at gmail.com
Thu Apr 27 21:29:53 UTC 2023
On Thursday, 27 April 2023 at 21:05:00 UTC, Mike Parker wrote:
> That's a compilation error, not a linker problem. You need to
> tell the compiler about the function with a prototype:
Declaring the function does fix the compiler problem. However, I
do get a linker error once I compile that:
```bash
$ g++ ../build/libshared-api.so main.cpp
/usr/bin/ld: /tmp/ccNMKxEE.o: in function `main':
main.cpp:(.text+0x2a): undefined reference to `foo()'
collect2: error: ld returned 1 exit status
```
More information about the Digitalmars-d-learn
mailing list