Ubuntu 13.04 - python 3.3
mathben opened this issue · 2 comments
Hi, i try to compile on Ubuntu 13.04 with python3-dev
Do you have any idea?
Thanks
Cmd: gcc -g -I /usr/include/python3.3m/ -L /usr/local/lib/ -lpython3.3m -dynamiclib pyinjectcode.c -o pyinjectcode.so
cc1: warning: unrecognized gcc debugging option: y [enabled by default]
cc1: warning: unrecognized gcc debugging option: n [enabled by default]
cc1: warning: unrecognized gcc debugging option: m [enabled by default]
cc1: warning: unrecognized gcc debugging option: i [enabled by default]
cc1: warning: unrecognized gcc debugging option: c [enabled by default]
cc1: warning: unrecognized gcc debugging option: l [enabled by default]
cc1: warning: unrecognized gcc debugging option: i [enabled by default]
cc1: warning: unrecognized gcc debugging option: b [enabled by default]
pyinjectcode.c: In function ‘runPythonFile’:
pyinjectcode.c:76:2: warning: passing argument 1 of ‘PyEval_EvalCode’ from incompatible pointer type [enabled by default]
In file included from /usr/include/python3.3m/Python.h:123:0,
from pyinjectcode.c:10:
/usr/include/python3.3m/eval.h:10:24: note: expected ‘struct PyObject *’ but argument is of type ‘struct PyCodeObject *’
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference to
main'
/tmp/ccUcovVl.o: In function parse_source_module': /root/lib_driver/pydbattach/pyinjectcode.c:37: undefined reference to
PyArena_New'
/root/lib_driver/pydbattach/pyinjectcode.c:43: undefined reference to PyParser_ASTFromFile' /root/lib_driver/pydbattach/pyinjectcode.c:51: undefined reference to
PyAST_CompileEx'
/root/lib_driver/pydbattach/pyinjectcode.c:53: undefined reference to PyArena_Free' /tmp/ccUcovVl.o: In function
runPythonFile':
/root/lib_driver/pydbattach/pyinjectcode.c:66: undefined reference to PyDict_New' /root/lib_driver/pydbattach/pyinjectcode.c:68: undefined reference to
PyEval_GetBuiltins'
/root/lib_driver/pydbattach/pyinjectcode.c:68: undefined reference to PyDict_SetItemString' /root/lib_driver/pydbattach/pyinjectcode.c:72: undefined reference to
PyUnicode_FromString'
/root/lib_driver/pydbattach/pyinjectcode.c:72: undefined reference to PyDict_SetItemString' /root/lib_driver/pydbattach/pyinjectcode.c:76: undefined reference to
PyEval_EvalCode'
/tmp/ccUcovVl.o: In function builtin_execfile': /root/lib_driver/pydbattach/pyinjectcode.c:129: undefined reference to
PyEval_SaveThread'
/root/lib_driver/pydbattach/pyinjectcode.c:131: undefined reference to PyEval_RestoreThread' /root/lib_driver/pydbattach/pyinjectcode.c:139: undefined reference to
PyExc_IOError'
/root/lib_driver/pydbattach/pyinjectcode.c:139: undefined reference to PyErr_SetFromErrnoWithFilename' /tmp/ccUcovVl.o: In function
t_bootstrap':
/root/lib_driver/pydbattach/pyinjectcode.c:156: undefined reference to PyThreadState_New' /root/lib_driver/pydbattach/pyinjectcode.c:159: undefined reference to
PySys_WriteStderr'
/root/lib_driver/pydbattach/pyinjectcode.c:160: undefined reference to PyErr_PrintEx' /root/lib_driver/pydbattach/pyinjectcode.c:164: undefined reference to
PyEval_AcquireThread'
/root/lib_driver/pydbattach/pyinjectcode.c:166: undefined reference to PySys_WriteStderr' /root/lib_driver/pydbattach/pyinjectcode.c:169: undefined reference to
PyExc_SystemExit'
/root/lib_driver/pydbattach/pyinjectcode.c:169: undefined reference to PyErr_ExceptionMatches' /root/lib_driver/pydbattach/pyinjectcode.c:170: undefined reference to
PyErr_Clear'
/root/lib_driver/pydbattach/pyinjectcode.c:172: undefined reference to PySys_WriteStderr' /root/lib_driver/pydbattach/pyinjectcode.c:173: undefined reference to
PyErr_PrintEx'
/root/lib_driver/pydbattach/pyinjectcode.c:174: undefined reference to PyErr_Clear' /root/lib_driver/pydbattach/pyinjectcode.c:180: undefined reference to
PySys_WriteStderr'
/root/lib_driver/pydbattach/pyinjectcode.c:183: undefined reference to PyThreadState_Clear' /root/lib_driver/pydbattach/pyinjectcode.c:184: undefined reference to
PyThreadState_DeleteCurrent'
/root/lib_driver/pydbattach/pyinjectcode.c:186: undefined reference to PyThread_exit_thread' /tmp/ccUcovVl.o: In function
startthread':
/root/lib_driver/pydbattach/pyinjectcode.c:196: undefined reference to PySys_WriteStderr' /root/lib_driver/pydbattach/pyinjectcode.c:197: undefined reference to
PyErr_PrintEx'
/root/lib_driver/pydbattach/pyinjectcode.c:201: undefined reference to PyThread_init_thread' /root/lib_driver/pydbattach/pyinjectcode.c:202: undefined reference to
PyEval_InitThreads'
/root/lib_driver/pydbattach/pyinjectcode.c:204: undefined reference to PyGILState_Ensure' /root/lib_driver/pydbattach/pyinjectcode.c:206: undefined reference to
PyThreadState_Get'
/root/lib_driver/pydbattach/pyinjectcode.c:207: undefined reference to PyThread_start_new_thread' /root/lib_driver/pydbattach/pyinjectcode.c:209: undefined reference to
PyGILState_Release'
/root/lib_driver/pydbattach/pyinjectcode.c:213: undefined reference to PySys_WriteStderr' /root/lib_driver/pydbattach/pyinjectcode.c:214: undefined reference to
PyErr_PrintEx'
/tmp/ccUcovVl.o: In function injected_PyEval_SetTraceEx': /root/lib_driver/pydbattach/pyinjectcode.c:230: undefined reference to
PyGILState_Ensure'
/root/lib_driver/pydbattach/pyinjectcode.c:248: undefined reference to `PyGILState_Release'
collect2: error: ld returned 1 exit status
I only tested it on MacOSX. You need to modify the compile command. I would guess it would be like this:
cc -shared -g -lc -I /usr/include/python3.3m/ -L /usr/local/lib/ pyinjectcode.c -o pyinjectcode.so
Your command works, thanks.