Home › Forum › SofaPython3 › Getting Started › [SOLVED] Errors while building SofaPython3 (Windows)
Tagged: SOFA_2106, Sofa2106, VS2019, Windows_10, Windows10
- This topic has 3 replies, 2 voices, and was last updated 2 years, 11 months ago by Julien D..
-
AuthorPosts
-
14 November 2021 at 20:08 #20786Julien D.Blocked
Hello everyone,
I am trying to migrate my python scenes from Sofa v20.12 to Sofa v21.06, still on Windows 10.
To do so, I have cloned the source code of Sofa v21.06 on my PC, and I have configured it on CMake, ticking successively “SofaFetch-sofaPython3” and “PLUGIN_SofaPython3”.
First of all, I have errors because lib files are missing, as described in the forum post https://www.sofa-framework.org/community/forum/topic/missing-lib-files/#post-20760 .
Therefore, the binaries of sofa 21.06 must be downloaded from sofa website, and the missing libs copied into the sofa/build/lib directories of your project. The same goes for the dynamic libraries (dll) files to be able to run Sofa.If you want to build Sofa 21.06 on windows doing so, everything works fine, the only unconvenience being to copy the missing files manually. But it works.
However, with SofaPython3, when I try to compile this plugin in tree (on Visual Studio 2019), I have the following errors :
– first ones : C2XXX
Erreur C2011 'pybind11::attribute_error' : redéfinition du type 'class' Plugin D:\Utilisateurs\jducrocq\Documents\Librairies\sofa\src\applications\plugins\SofaPython3\Plugin\src\SofaPython3\PythonFactory.cpp
– second ones : LNK 2019
Erreur LNK2019 symbole externe non résolu "__declspec(dllimport) public: __cdecl sofapython3::PythonTestData::~PythonTestData(void)" (__imp_??1PythonTestData@sofapython3@@QEAA@XZ) référencé dans la fonction "public: virtual void __cdecl testing::internal::ValuesInIteratorRangeGenerator<struct sofapython3::PythonTestData>::Iterator::Advance(void)" (?Advance@Iterator@?$ValuesInIteratorRangeGenerator@UPythonTestData@sofapython3@@@internal@testing@@UEAAXXZ) Bindings.Modules.Tests D:\Utilisateurs\jducrocq\Documents\Librairies\sofa\build\applications\plugins\SofaPython3\bindings\Modules\tests\main.obj
I don’t know at all how to solve these kind of errors, so if anyone could help me I’d be very glad !
Have a good start of week everyone,
Best wishes,
Julien D
19 November 2021 at 14:42 #20827FroyKeymasterHello,
This problem is due to an update of pybind (I am expecting you to have a recent version of pybind, i.e > 2.8).
This is fixed in this PR https://github.com/sofa-framework/SofaPython3/pull/216
You can also fix it by downgrading your own version of pybind.Fred
19 November 2021 at 14:57 #20828Julien D.BlockedHello @Froy,
ok, thank you, I’ll try that very soon (not today but soonie) and I’ll keep this forum in touch 🙂
Thank you very much for your help !
Julien
21 November 2021 at 18:29 #20838 -
AuthorPosts
- You must be logged in to reply to this topic.