<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68188>68188</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Linker Error while compiling SOFA
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sandeep-amd
</td>
</tr>
</table>
<pre>
Hi,
While trying to compile SOFA(https://github.com/sofa-framework/sofa => branch "v23.06") with LLVM 16 , we are getting linker errors as below,
**ld.lld: error: undefined reference due to --no-allow-shlib-undefined: vtable for sofa::linearalgebra::FullVector<double>
>>> referenced by ../../../lib/libSofa.Component.Constraint.Lagrangian.Solver.so.23.06.00
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Sofa/Component/Haptics/CMakeFiles/Sofa.Component.Haptics.dir/build.make:176: lib/libSofa.Component.Haptics.so.23.06.00] Error 1
make[2]: Leaving directory '/home/amd/sandeep/sofa/sofa/build'
make[1]: *** [CMakeFiles/Makefile2:9861: Sofa/Component/Haptics/CMakeFiles/Sofa.Component.Haptics.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....**
To reproduce this, we have provided a single line command with all the object files attached . The command to reproduce this issue is as below,
**/home/amd/compiler/llvm_16_src/llvm_install/bin/clang++ -fPIC -O3 -march=znver3 -flto -Wl,--no-allow-shlib-undefined -O3 -DNDEBUG -flto -Wl,--no-allow-shlib-undefined -shared -Wl,-soname,libSofa.Component.Haptics.so.23.06.00 -o ./libSofa.Component.Haptics.so.23.06.00 ./init.cpp.o ./ForceFeedback.cpp.o ./LCPForceFeedback.cpp.o ./NullForceFeedback.cpp.o ./NullForceFeedbackT.cpp.o -Wl,-rpath,/home/amd/sandeep/sofa/sofa/build/lib: ./libSofa.Component.Constraint.Lagrangian.Solver.so.23.06.00 ./libSofa.Simulation.Core.so.23.06.00 ./libSofa.Core.so.23.06.00 ./libSofa.DefaultType.so.23.06.00 ./libSofa.LinearAlgebra.so.23.06.00 ./libSofa.Helper.so.23.06.00 ./libSofa.Topology.so.23.06.00 ./libSofa.Geometry.so.23.06.00 ./libSofa.Type.so.23.06.00 ./libSofa.Compat.so.23.06.00 ./libSofa.Component.Compat.so.23.06.00 ./libSofa.Config.so.23.06.00**
We have attached the object files required to reproduce this issue. Please do let us know the solution.
Thanks,
[Sofa_Obj.tar.gz](https://github.com/llvm/llvm-project/files/12800919/Sofa_Obj.tar.gz)
Sandeep.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVl9vo74S_TTOywgLTEOShzykSdm9UvaP1N7t48rgAbwxNtc2ye1--p8MtGm7m25X-knIgH3GnjmeOTZ3TtYacU3m12S-m_HeN8auHdcCsYt4K2aFEQ_rj5KwLYl3JN6M7X0jFYK3D1LX4A2Upu1Cz-2XfEPYsvG-cyTdEJYTltfSN31BS9MSljtT8aiyvMWTsYepA0i6I-kNFJbrsgHC2JGlNM4IY4St4CR9A_v9t0-QZEDYFk4I3CLU6H1wQEl9QAtorbEOuIMClTm9cpmw8ChBlRIk3Yzo8NFrgZXUKMBihRZ1iSB6DGFFkTYRV8qcItcoWURP2GB49LxQCJWxEIII8aYbJTVyy1WNhZ268l6pb1j6sNxWmL5QSNKbyav0ZnzOiwsoHoBSwvJzo2Qxtrem4nRr2s5o1J5ujXbecqk93fPacl1LrumtUUe01Bk6sEjjeFysVFzXUZK9CH8irzRty7WAikuFYqQc_y89lEYgJEDYsncI0THw4hBB6qMpuZdGE7Ya52_5Acn8mpH5Lsw8Mk7YBsj8OjhOWP7kOmH5R955WbrQ-4kfMJcKw8-rECcUFdISlhe9VIIOC6WbZJGNEfyenEfL5zzMd3ATIofkty7vkR9DRglphw17AMIWhOWNaZGwnLciZOxYHlPunl-DbwH_fObkd2S8iDd8V1IhI-lmtcySgP6X2OJKnSNmf_DrnsuhmkI-97qSWroGBfwwhaM0ZOEAfFZRdwYsdtaIvkTwjXRTaTb8iNBZ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