You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm trying to make chapter2 / server3-4 and have problem with linking.
Why could this happen? How to fix?
(py275)MacBook-Air-Ivan:cython-book (master) $ cd ./chapter2/messaging-server/server4
(py275)MacBook-Air-Ivan:server4 (master) $ make
cython -2 -o pyserver.c pyserver.pyx
gcc -g -O2 -Wall -fpic -c server.c -o server.o
gcc -g -O2 -Wall -fpic -c pyserver.c -o pyserver.o `python-config --cflags`
pyserver.c:2157:28: warning: unused function '__Pyx_PyObject_AsString' [-Wunused-function]
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
^
pyserver.c:2154:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
pyserver.c:298:29: warning: unused function '__Pyx_Py_UNICODE_strlen' [-Wunused-function]
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
^
pyserver.c:2269:33: warning: unused function '__Pyx_PyIndex_AsSsize_t' [-Wunused-function]
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
^
pyserver.c:2294:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
^
pyserver.c:1988:32: warning: unused function '__Pyx_PyInt_From_long' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
^
pyserver.c:2014:27: warning: function '__Pyx_PyInt_As_long' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
^
7 warnings generated.
pyserver.c:2157:28: warning: unused function '__Pyx_PyObject_AsString' [-Wunused-function]
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
^
pyserver.c:2154:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
pyserver.c:298:29: warning: unused function '__Pyx_Py_UNICODE_strlen' [-Wunused-function]
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
^
pyserver.c:2269:33: warning: unused function '__Pyx_PyIndex_AsSsize_t' [-Wunused-function]
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
^
pyserver.c:2294:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
^
pyserver.c:1988:32: warning: unused function '__Pyx_PyInt_From_long' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
^
pyserver.c:2014:27: warning: function '__Pyx_PyInt_As_long' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
^
7 warnings generated.
gcc -g -O2 -shared -o pyserver.so server.o pyserver.o -levent
Undefined symbols for architecture x86_64:
"_PyCFunction_NewEx", referenced from:
_initpyserver in pyserver.o
"_PyCFunction_Type", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
"_PyCode_New", referenced from:
_initpyserver in pyserver.o
___Pyx_AddTraceback in pyserver.o
"_PyDict_GetItem", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyDict_New", referenced from:
_initpyserver in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyDict_SetItem", referenced from:
_initpyserver in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyErr_ExceptionMatches", referenced from:
_initpyserver in pyserver.o
"_PyErr_Format", referenced from:
_initpyserver in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
___Pyx_PyInt_As_int in pyserver.o
"_PyErr_Occurred", referenced from:
_initpyserver in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
___Pyx_PyInt_As_int in pyserver.o
...
"_PyErr_SetString", referenced from:
_initpyserver in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
___Pyx_PyInt_As_int in pyserver.o
...
"_PyErr_WarnEx", referenced from:
_initpyserver in pyserver.o
"_PyErr_WriteUnraisable", referenced from:
___Pyx_WriteUnraisable in pyserver.o
"_PyExc_AttributeError", referenced from:
_initpyserver in pyserver.o
"_PyExc_ImportError", referenced from:
_initpyserver in pyserver.o
"_PyExc_NameError", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyExc_OverflowError", referenced from:
___Pyx_PyInt_As_int in pyserver.o
"_PyExc_RuntimeError", referenced from:
___Pyx_PrintOne in pyserver.o
"_PyExc_SystemError", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyExc_TypeError", referenced from:
___Pyx_PyInt_As_int in pyserver.o
"_PyFile_SoftSpace", referenced from:
___Pyx_PrintOne in pyserver.o
"_PyFile_WriteObject", referenced from:
___Pyx_PrintOne in pyserver.o
"_PyFile_WriteString", referenced from:
___Pyx_PrintOne in pyserver.o
"_PyFrame_New", referenced from:
___Pyx_AddTraceback in pyserver.o
"_PyImport_AddModule", referenced from:
_initpyserver in pyserver.o
"_PyInt_FromLong", referenced from:
_initpyserver in pyserver.o
"_PyList_New", referenced from:
_initpyserver in pyserver.o
"_PyLong_AsLong", referenced from:
___Pyx_PyInt_As_int in pyserver.o
"_PyMem_Malloc", referenced from:
___Pyx_AddTraceback in pyserver.o
"_PyMem_Realloc", referenced from:
___Pyx_AddTraceback in pyserver.o
"_PyMethod_Type", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
"_PyModule_GetDict", referenced from:
_initpyserver in pyserver.o
"_PyNumber_Int", referenced from:
___Pyx_PyInt_As_int in pyserver.o
"_PyNumber_Long", referenced from:
___Pyx_PyInt_As_int in pyserver.o
"_PyOS_snprintf", referenced from:
_initpyserver in pyserver.o
"_PyObject_Call", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyObject_CallFunctionObjArgs", referenced from:
_initpyserver in pyserver.o
"_PyObject_GetAttr", referenced from:
_initpyserver in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyObject_IsTrue", referenced from:
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyObject_SetAttrString", referenced from:
_initpyserver in pyserver.o
"_PyString_FromFormat", referenced from:
___Pyx_AddTraceback in pyserver.o
"_PyString_FromString", referenced from:
___Pyx_AddTraceback in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
___Pyx_WriteUnraisable in pyserver.o
"_PyString_FromStringAndSize", referenced from:
_initpyserver in pyserver.o
"_PyString_InternFromString", referenced from:
_initpyserver in pyserver.o
"_PySys_GetObject", referenced from:
___Pyx_PrintOne in pyserver.o
"_PyTraceBack_Here", referenced from:
___Pyx_AddTraceback in pyserver.o
"_PyTuple_New", referenced from:
_initpyserver in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"_PyTuple_Pack", referenced from:
_initpyserver in pyserver.o
"_PyUnicodeUCS2_DecodeUTF8", referenced from:
_initpyserver in pyserver.o
"_Py_GetVersion", referenced from:
_initpyserver in pyserver.o
"_Py_InitModule4_64", referenced from:
_initpyserver in pyserver.o
"__PyThreadState_Current", referenced from:
___Pyx_AddTraceback in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
___Pyx_WriteUnraisable in pyserver.o
...
"__Py_CheckRecursionLimit", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"__Py_CheckRecursiveCall", referenced from:
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___Pyx_PyObject_CallOneArg in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"__Py_NoneStruct", referenced from:
_initpyserver in pyserver.o
___pyx_pw_8pyserver_1pyinit_server in pyserver.o
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
___Pyx_WriteUnraisable in pyserver.o
"__Py_TrueStruct", referenced from:
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
"__Py_ZeroStruct", referenced from:
___pyx_f_8pyserver_pyconnect_callback in pyserver.o
___pyx_f_8pyserver_pydisconnect_callback in pyserver.o
___pyx_f_8pyserver_pyread_callback in pyserver.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1
The text was updated successfully, but these errors were encountered:
Hi! I'm trying to make chapter2 / server3-4 and have problem with linking.
Why could this happen? How to fix?
The text was updated successfully, but these errors were encountered: