Dear clang list,
first thank you a lot for providing clang, clang is really so much
better for error messages (especially templates) than gcc!
I build a shared library essentialy with the CMake part
add_library(integration quadraturePy.cpp quadratureRulesPy.cpp)
In the file `quadratureRulesPy.cpp` the constructor for the template
QuadratureRules<double, 0> is define. It is also part of the object
file:
nm -C CMakeFiles/integration.dir/quadratureRulesPy.cpp.o | grep "parfem::QuadratureRules<double, 0>::QuadratureRules"
00000000 W parfem::QuadratureRules<double, 0>::QuadratureRules(unsigned int)
In the file `quadraturePy.cpp` this symbol is not defined, and thus
also not part of the object file:
nm -C CMakeFiles/integration.dir/quadraturePy.cpp.o | grep "parfem::QuadratureRules<double, 0>::QuadratureRules"
U parfem::QuadratureRules<double, 0>::QuadratureRules(unsigned int)
In the final library both object files are combined and the symbol
appears twice:
nm -C libintegration.so | grep "parfem::QuadratureRules<double, 0>::QuadratureRules"
U parfem::QuadratureRules<double, 0>::QuadratureRules(unsigned int)
000ad400 W parfem::QuadratureRules<double, 0>::QuadratureRules(unsigned int)
Once this library is loaded from python, I get the following linker error:
ImportError: libintegration.so: undefined symbol:
_ZN6parfem15QuadratureRulesIdLi0EEC1Ej
(where c++filt shows that the problem is exactly this symbol.