Cythonをで次のようなPythonのコードをコンパイルしてリンクすると、次のようなエラーが発生しました。実行環境はWindows10 WSL2のUbuntu 20.04.1 LTSです。Pythonのバージョンは3.8です。
#cython: language_level=3
# hellp.py
print("Hello Python!")
まず、CythonでCに変換します。
$cython3 --embed hello.py
次にgccで実行ファイルを生成すると、undefined reference toが大量に発生します。
$cython3 --embed hello.py
$gcc -O2 -Wall -fno-strict-aliasing -I/usr/include/python3.8 -lpython3.8 -o hello hello.c
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_CallMethO':
optpdf.c:(.text.unlikely+0x7f): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x8b): undefined reference to `_Py_CheckRecursionLimit'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xa0): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xaf): undefined reference to `_Py_CheckRecursionLimit'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xcd): undefined reference to `_Py_CheckRecursiveCall'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xdf): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xed): undefined reference to `PyErr_Occurred'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xfc): undefined reference to `PyExc_SystemError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x108): undefined reference to `PyErr_SetString'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_Call':
optpdf.c:(.text.unlikely+0x142): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x14e): undefined reference to `_Py_CheckRecursionLimit'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x166): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x175): undefined reference to `_Py_CheckRecursionLimit'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x193): undefined reference to `_Py_CheckRecursiveCall'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a5): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1b3): undefined reference to `PyErr_Occurred'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1c2): undefined reference to `PyExc_SystemError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1ce): undefined reference to `PyErr_SetString'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_LookupSpecial':
optpdf.c:(.text.unlikely+0x1f4): undefined reference to `_PyType_Lookup'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x22c): undefined reference to `PyExc_AttributeError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x234): undefined reference to `PyErr_SetObject'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyFunction_FastCallNoKw':
optpdf.c:(.text.unlikely+0x259): undefined reference to `_PyThreadState_UncheckedGet'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2b4): undefined reference to `PyFrame_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x312): undefined reference to `PyEval_EvalFrameEx'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x326): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_ErrRestoreInState':
optpdf.c:(.text.unlikely+0x367): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x37a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_AddTraceback':
optpdf.c:(.text.unlikely+0x3b6): undefined reference to `_PyThreadState_UncheckedGet'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3f7): undefined reference to `_PyObject_GetDictPtr'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x42f): undefined reference to `_PyDict_GetItem_KnownHash'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x473): undefined reference to `PyObject_Not'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x47f): undefined reference to `_Py_FalseStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x488): undefined reference to `_Py_TrueStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x49b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4a7): undefined reference to `PyErr_Clear'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4c3): undefined reference to `_Py_FalseStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4cb): undefined reference to `PyObject_SetAttr'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4d4): undefined reference to `_Py_FalseStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4e0): undefined reference to `_Py_TrueStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4ed): undefined reference to `PyObject_Not'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x55d): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x589): undefined reference to `PyUnicode_FromFormat'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x596): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5cd): undefined reference to `PyCode_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5ea): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5f8): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x620): undefined reference to `PyMem_Malloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x68b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x6a6): undefined reference to `PyMem_Realloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x70e): undefined reference to `PyFrame_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x721): undefined reference to `PyTraceBack_Here'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x73b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_copy_spec_to_module':
optpdf.c:(.text.unlikely+0x784): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x793): undefined reference to `_Py_NoneStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x7ae): undefined reference to `PyDict_SetItemString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x7bf): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x7c8): undefined reference to `PyExc_AttributeError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x7d1): undefined reference to `PyErr_ExceptionMatches'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x7da): undefined reference to `PyErr_Clear'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_create':
optpdf.c:(.text.unlikely+0x7fd): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x806): undefined reference to `PyInterpreterState_GetID'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x82d): undefined reference to `PyExc_ImportError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x839): undefined reference to `PyErr_SetString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x865): undefined reference to `PyObject_GetAttrString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x875): undefined reference to `PyModule_NewObject'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x885): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x892): undefined reference to `PyModule_GetDict'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x93e): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_IsSubtype':
optpdf.c:(.text.unlikely+0x9ba): undefined reference to `PyBaseObject_Type'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyCFunction_FastCall':
optpdf.c:(.text.unlikely+0x9f6): undefined reference to `PyCFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xa4b): undefined reference to `PyErr_Occurred'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_IterFinish':
optpdf.c:(.text.unlikely+0xb70): undefined reference to `_PyThreadState_UncheckedGet'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xb80): undefined reference to `PyExc_StopIteration'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xbb6): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xbdc): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xbef): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_ImportFrom':
optpdf.c:(.text.unlikely+0xc15): undefined reference to `PyExc_AttributeError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xc1a): undefined reference to `PyErr_ExceptionMatches'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xc25): undefined reference to `PyExc_ImportError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xc36): undefined reference to `PyErr_Format'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_GetBuiltinName':
optpdf.c:(.text.unlikely+0xc65): undefined reference to `PyExc_NameError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xc76): undefined reference to `PyErr_Format'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx__GetModuleGlobalName':
optpdf.c:(.text.unlikely+0xca3): undefined reference to `_PyDict_GetItem_KnownHash'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xcc8): undefined reference to `PyErr_Occurred'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx__ExceptionReset.isra.0':
optpdf.c:(.text.unlikely+0xd14): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xd27): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_Import.constprop.0':
optpdf.c:(.text.unlikely+0xd5b): undefined reference to `PyList_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xd7c): undefined reference to `PyModule_GetDict'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xd89): undefined reference to `PyDict_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xda5): undefined reference to `PyImport_ImportModuleLevelObject'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xdc8): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xddb): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PrintOne.constprop.0':
optpdf.c:(.text.unlikely+0xdff): undefined reference to `PyTuple_Pack'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xe22): undefined reference to `PyObject_Call'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xe3f): undefined reference to `PyObject_GetAttr'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xe61): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xe6f): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyInt_AddCObj.isra.0.constprop.0':
optpdf.c:(.text.unlikely+0xe82): undefined reference to `PyLong_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xef5): undefined reference to `PyFloat_Type'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyInt_SubtractObjC.isra.0.constprop.0':
optpdf.c:(.text.unlikely+0xf17): undefined reference to `PyLong_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xf80): undefined reference to `PyFloat_Type'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_GetItem':
optpdf.c:(.text.unlikely+0xfe7): undefined reference to `PyExc_TypeError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xff8): undefined reference to `PyErr_Format'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1004): undefined reference to `PyLong_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1072): undefined reference to `PyLong_AsSsize_t'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x107f): undefined reference to `PyNumber_Index'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x108c): undefined reference to `PyErr_Occurred'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x10a5): undefined reference to `PyLong_AsSsize_t'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x10b5): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x10c7): undefined reference to `PyList_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x115a): undefined reference to `PyTuple_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x120e): undefined reference to `PyExc_OverflowError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1213): undefined reference to `PyErr_ExceptionMatches'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x121c): undefined reference to `PyErr_Clear'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1238): undefined reference to `PyLong_FromSsize_t'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x124b): undefined reference to `PyObject_GetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x125c): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1265): undefined reference to `PyExc_OverflowError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x126a): undefined reference to `PyErr_GivenExceptionMatches'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1273): undefined reference to `PyErr_Clear'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x127e): undefined reference to `PyExc_IndexError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1290): undefined reference to `PyErr_Format'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyFunction_FastCallDict.constprop.0':
optpdf.c:(.text.unlikely+0x12c5): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x12d1): undefined reference to `_Py_CheckRecursionLimit'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x12ef): undefined reference to `_Py_CheckRecursiveCall'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x13dd): undefined reference to `PyEval_EvalCodeEx'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x13e9): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x13f8): undefined reference to `_Py_CheckRecursionLimit'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1413): undefined reference to `PyThreadState_Get'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_Call2Args':
optpdf.c:(.text.unlikely+0x1432): undefined reference to `PyFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x147e): undefined reference to `PyCFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x14bc): undefined reference to `PyTuple_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1554): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1562): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_CallOneArg':
optpdf.c:(.text.unlikely+0x1593): undefined reference to `PyFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x15c8): undefined reference to `PyCFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1617): undefined reference to `PyTuple_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1670): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x16c8): undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x16d4): undefined reference to `PyErr_SetString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1702): undefined reference to `PyOS_snprintf'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x170c): undefined reference to `Py_GetVersion'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1725): undefined reference to `PyOS_snprintf'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1764): undefined reference to `PyOS_snprintf'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1773): undefined reference to `PyErr_WarnEx'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1782): undefined reference to `PyFrame_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1794): undefined reference to `PyTuple_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x17b2): undefined reference to `PyBytes_FromStringAndSize'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x17d0): undefined reference to `PyUnicode_FromStringAndSize'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x17ec): undefined reference to `PyModule_GetDict'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x180b): undefined reference to `PyImport_AddModule'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x182a): undefined reference to `PyImport_AddModule'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x186a): undefined reference to `PyObject_SetAttrString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x189a): undefined reference to `PyUnicode_InternFromString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x18bc): undefined reference to `PyUnicode_Decode'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x18cb): undefined reference to `PyUnicode_FromStringAndSize'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x18e2): undefined reference to `PyBytes_FromStringAndSize'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x18fe): undefined reference to `PyObject_Hash'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1917): undefined reference to `PyLong_FromLong'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1931): undefined reference to `PyLong_FromLong'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x194b): undefined reference to `PyLong_FromLong'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1965): undefined reference to `PyLong_FromLong'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1987): undefined reference to `PyImport_GetModuleDict'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x19a2): undefined reference to `PyDict_GetItemString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a21): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a28): undefined reference to `PyErr_Occurred'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a34): undefined reference to `PyExc_ImportError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a40): undefined reference to `PyErr_SetString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a6e): undefined reference to `PyObject_SetAttr'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1a9d): undefined reference to `PyDict_SetItemString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1ae5): undefined reference to `PyTuple_Pack'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1b1c): undefined reference to `PyTuple_Pack'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1b3b): undefined reference to `PyTuple_Pack'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1b4e): undefined reference to `_Py_NoneStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1b60): undefined reference to `PyTuple_Pack'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1b76): undefined reference to `PyList_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1bc4): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1bf5): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1c0b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1c18): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1c48): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1c5d): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1c67): undefined reference to `PyList_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1ce5): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1d16): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1d2b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1d5c): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1d71): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1da2): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1db7): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1dc5): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1df5): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1e0b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1e3b): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1e51): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1edd): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1efa): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1f62): undefined reference to `PyDict_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1f84): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1fb7): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1fc5): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1fdb): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x1ff1): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x205c): undefined reference to `PyObject_Size'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2077): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x207f): undefined reference to `PyLong_FromSsize_t'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2095): undefined reference to `PyUnicode_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x20b4): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x20c3): undefined reference to `PyNumber_Add'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x20dd): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x20fb): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2166): undefined reference to `PyObject_Size'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2181): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2189): undefined reference to `PyLong_FromSsize_t'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x21be): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x21ca): undefined reference to `PyTuple_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x21db): undefined reference to `PyList_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x21ff): undefined reference to `PyObject_GetIter'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2238): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2250): undefined reference to `PyList_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2302): undefined reference to `PyErr_Occurred'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2315): undefined reference to `PyExc_StopIteration'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x231f): undefined reference to `PyErr_Clear'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x235a): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2370): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x23dd): undefined reference to `PyUnicode_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x23fc): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x240b): undefined reference to `PyNumber_Add'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2424): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2442): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x252d): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x253a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2563): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x256e): undefined reference to `PyList_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2591): undefined reference to `PyExc_ValueError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x25a4): undefined reference to `PyErr_Format'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x25cb): undefined reference to `PyExc_ValueError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x25dd): undefined reference to `PyErr_Format'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x263f): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x264c): undefined reference to `PyObject_GetIter'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x266a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x26cf): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x26db): undefined reference to `PyExc_ValueError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x26fe): undefined reference to `PyErr_Format'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2732): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x274c): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x276d): undefined reference to `PyExc_ValueError'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2799): undefined reference to `PyErr_Format'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x27b4): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x27ca): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x27e0): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x27f6): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2810): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2832): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2854): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x28e8): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2973): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2a03): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2a8f): undefined reference to `PyNumber_Subtract'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2aad): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2aba): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2b4a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2bd6): undefined reference to `PyNumber_Subtract'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2bf4): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2c01): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2c0b): undefined reference to `PyTuple_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2ce1): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2cf6): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2de0): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2dee): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2e17): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2e81): undefined reference to `PyMethod_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2eab): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2ede): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2eec): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2f02): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x2fef): undefined reference to `PyObject_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3009): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3017): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3024): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x310f): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x311d): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o:optpdf.c:(.text.unlikely+0x3145): more undefined references to `_Py_Dealloc' follow
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x31d7): undefined reference to `PyMethod_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3201): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3234): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3242): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3258): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3345): undefined reference to `PyObject_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x335f): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x336d): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x337a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3465): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3473): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o:optpdf.c:(.text.unlikely+0x349b): more undefined references to `_Py_Dealloc' follow
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x34a2): undefined reference to `PyMethod_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x34ca): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3505): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x351c): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3609): undefined reference to `PyObject_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3623): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3630): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x363d): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3727): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3735): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o:optpdf.c:(.text.unlikely+0x375e): more undefined references to `_Py_Dealloc' follow
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x37cb): undefined reference to `PyUnicode_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x37ea): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x37f9): undefined reference to `PyNumber_Add'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3812): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3821): undefined reference to `PyNumber_Add'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x383b): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3842): undefined reference to `PyMethod_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3877): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3896): undefined reference to `PyFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x38ec): undefined reference to `PyCFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3961): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x396e): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x397e): undefined reference to `PyTuple_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3a61): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3a6f): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3a81): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3aa8): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3b0a): undefined reference to `PyFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3b27): undefined reference to `PyCFunction_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3b6f): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3b7d): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3b82): undefined reference to `_PyThreadState_UncheckedGet'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3b89): undefined reference to `_Py_NoneStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3c0d): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3c22): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3cae): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3d39): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3dc4): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3def): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3df7): undefined reference to `PySequence_List'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e10): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e18): undefined reference to `PyList_Sort'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e45): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e52): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e76): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e84): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3e92): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o:optpdf.c:(.text.unlikely+0x3ebc): more undefined references to `_Py_Dealloc' follow
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x3f4e): undefined reference to `PyDict_New'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3f7c): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3f97): undefined reference to `PyDict_SetItem'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x3fb1): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4441): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4487): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x44bb): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x44d8): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o:optpdf.c:(.text.unlikely+0x450c): more undefined references to `_Py_Dealloc' follow
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x4d10): undefined reference to `PyErr_NormalizeException'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4d43): undefined reference to `PyException_SetTraceback'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4db6): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4dc9): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4de3): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4dfc): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4e10): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o:optpdf.c:(.text.unlikely+0x4e24): more undefined references to `_Py_Dealloc' follow
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__pyx_pymod_exec_optpdf':
optpdf.c:(.text.unlikely+0x4e7f): undefined reference to `PyTuple_Pack'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4ea9): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4eb7): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4ec7): undefined reference to `_Py_TrueStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4ece): undefined reference to `_Py_FalseStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4eed): undefined reference to `_Py_NoneStruct'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4efa): undefined reference to `PyObject_IsTrue'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4f0a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4f1a): undefined reference to `PyThreadState_Get'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4f58): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4f6a): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x4f94): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_main.part.0':
optpdf.c:(.text.unlikely+0x5093): undefined reference to `PyModule_Type'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50a4): undefined reference to `PyType_IsSubtype'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50b4): undefined reference to `PyUnicode_FromString'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50c4): undefined reference to `PyModule_NewObject'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50d5): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50e8): undefined reference to `PyModule_ExecDef'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50f1): undefined reference to `PyErr_Occurred'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x50fb): undefined reference to `PyErr_Print'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5115): undefined reference to `_Py_Dealloc'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x511a): undefined reference to `Py_FinalizeEx'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `main.cold':
optpdf.c:(.text.unlikely+0x5131): undefined reference to `Py_SetProgramName'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5136): undefined reference to `Py_Initialize'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5142): undefined reference to `PySys_SetArgv'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5177): undefined reference to `Py_SetProgramName'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x517c): undefined reference to `Py_Initialize'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x5188): undefined reference to `PySys_SetArgv'
/usr/bin/ld: optpdf.c:(.text.unlikely+0x519b): undefined reference to `Py_Initialize'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_GetAttrStr':
optpdf.c:(.text.unlikely+0x5f): undefined reference to `PyObject_GetAttr'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyObject_Call':
optpdf.c:(.text.unlikely+0x13d): undefined reference to `PyObject_Call'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_ErrRestoreInState':
optpdf.c:(.text.unlikely+0x391): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_AddTraceback':
optpdf.c:(.text.unlikely+0x75c): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyErr_GivenExceptionMatches.part.0':
optpdf.c:(.text.unlikely+0xb57): undefined reference to `PyErr_GivenExceptionMatches'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx__ExceptionReset.isra.0':
optpdf.c:(.text.unlikely+0xd3e): undefined reference to `_Py_Dealloc'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyInt_AddCObj.isra.0.constprop.0':
optpdf.c:(.text.unlikely+0xeee): undefined reference to `PyLong_FromLong'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xf07): undefined reference to `PyFloat_FromDouble'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xf0c): undefined reference to `PyNumber_Add'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `__Pyx_PyInt_SubtractObjC.isra.0.constprop.0':
optpdf.c:(.text.unlikely+0xf79): undefined reference to `PyLong_FromLong'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xf97): undefined reference to `PyFloat_FromDouble'
/usr/bin/ld: optpdf.c:(.text.unlikely+0xf9c): undefined reference to `PyNumber_Subtract'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `PyInit_optpdf':
optpdf.c:(.text.unlikely+0x5079): undefined reference to `PyModuleDef_Init'
/usr/bin/ld: /tmp/ccXRRMfE.o: in function `main':
optpdf.c:(.text.startup+0x2f2): undefined reference to `PyMem_RawFree'
collect2: error: ld returned 1 exit status
解決策
こちらのサイトを参考にgccのオプションを指定すると、問題なく実行ファイルを生成することができました。
$gcc -O2 $(python3-config --cflags) -fPIE -c hello.c -o hello.o
$gcc hello.o $(python3-config --embed --ldflags) -o hello