Comment #0 by alphaglosined — 2022-08-09T14:06:45Z
When compiling against C++ object files, it is possible that the compiler has stripped symbols out of the object file.
For instance, if you have the following code in a cpp file:
```c++
#include <iostream>
struct Foo
{
void print()
{
std::cout << "foo: " << a << ": hello from c++\n";
}
int a;
};
```
And try to link against it when compiling with ``clang -c`` it will result in the linker error: ``undefined reference to 'Foo::print()'``.
This is worth mentioning in the docs for Interfacing to C++ page as it could be a gotcha that can lead to people spinning their wheels (it was encountered by someone on Discord).
Comment #1 by robert.schadek — 2024-12-15T15:27:31Z