When I compile this simple C++ file into an object file the function symbol does not get exported in the output object file.
// A.cpp
#include <iostream>
using namespace std;
extern inline void f1() {
cout << "f1" << endl;
}
Compiled with: clang++ -c A.cpp -o A.o
When I check the exported symbols (nm A.o
), I can see that the function has been excluded.
My understanding is that the 'extern' should specify that I want external linkage to be possible, so in this case why does it get excluded from the output object file? Removing the inline
resolves the issue.