undefined reference to `PyCMethod_New'
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
My environment:
Ubuntu 20.04
Python 3.8.10
When I run compile a program use pybind11, it raise a error:
/usr/bin/ld: ../scripting/libscripting.a(python_scripting.cpp.o): in function `pybind11::cpp_function::initialize_generic(std::unique_ptr<pybind11::detail::function_record, pybind11::cpp_function::InitializingFunctionRecordDeleter>&&, char const*, std::type_info const* const*, unsigned long)':
/home/../ubuntu/kicad/thirdparty/pybind11/include/pybind11/pybind11.h:415: undefined reference to `PyCMethod_New'
collect2: error: ld returned 1 exit status
make[2]: *** [bitmap2component/CMakeFiles/bitmap2component.dir/build.make:191: bitmap2component/bitmap2component] Error 1
make[1]: *** [CMakeFiles/Makefile2:3754: bitmap2component/CMakeFiles/bitmap2component.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the link failure with Ubuntu 20.04 and Python 3.8.10, then inspect pybind11/pybind11.h around line 415 and the build involving python_scripting.cpp.o. Done means the affected program links successfully on the reported environment, with a regression check for the reported undefined reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100