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
```


Reply via email to