[Python] Using a Python module generated with Boost: did not match C++ signature

Discussão em 'Python' iniciado por Stack, Junho 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am using a software called Mitsuba. It comes along with a Python implementation, wrapped with Boost. This line in Python:

    scene = SceneHandler.loadScene(fileResolver.resolve("model.xml"), paramMap)


    yields an error. The type of fileResolver.resolve is fs::path and the type of paramMap is ParameterMap according to the documentation.

    The function signature in the C++ code is:

    SceneHandler::loadScene(const fs::path &filename, const ParameterMap &params)


    The error is:

    Traceback (most recent call last):
    File "...\foo.py", line 22, in <module>
    scene = SceneHandler.loadScene(fileResolver.resolve("model.xml"), paramMap)
    ArgumentError: Python argument types in
    SceneHandler.loadScene(str, StringMap)
    did not match C++ signature:
    loadScene(class boost::filesystem2::basic_path<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem2::path_traits>, class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mitsuba::SimpleStringOrdering,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >)


    What further investigations can I make? Do you know where the problem comes from?

    Continue reading...

Compartilhe esta Página