error message when compiling cx-freeze 4.3.2 against python3.3 in Ubuntu 13.10 -> /home/max/python/cx_Freeze-4.3.2/source/bases/Console.c:36: référence indéfinie vers « PyErr_Print »

Asked by Max D

I want to install cx-freeze for python3, but the build command returns multiple errors and stops.

    running build_ext
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Ibuild/temp.linux-x86_64-3.3 -I/usr/include/python3.3m -c source/bases/Console.c -o build/temp.linux-x86_64-3.3/source/bases/Console.o
    In file included from source/bases/Console.c:41:0:
    source/bases/Common.c: In function ‘ExecuteScript’:
    source/bases/Common.c:307:5: warning: passing argument 1 of ‘PyEval_EvalCode’ from incompatible pointer type [enabled by default]
         temp = PyEval_EvalCode( (PyCodeObject*) code, dict, dict);
                         ^
    In file included from /usr/include/python3.3m/Python.h:123:0,
                     from source/bases/Console.c:6:
    /usr/include/python3.3m/eval.h:10:24: note: expected ‘struct PyObject *’ but argument is of type ‘struct PyCodeObject *’
 PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);

  [.....]

    build/temp.linux-x86_64-3.3/source/bases/Console.o: dans la fonction « FatalScriptError »:
    /home/max/python/cx_Freeze-4.3.2/source/bases/Console.c:36: référence indéfinie vers « PyErr_Print »
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cx-freeze Edit question
Assignee:
No assignee Edit question
Solved by:
Mark Rijckenberg
Solved:
Last query:
Last reply:
Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#1

Why not install from the repositories using apt-get?

sudo apt-get update

sudo apt-get install cx-freeze

Source: http://packages.ubuntu.com/saucy/cx-freeze

Revision history for this message
Max D (maxdesp) said :
#2

Thank you,

Yes, but i need it installed on python3.3,
and the repository installed it for python2 only, i don't get why.
I've already tried to compile from the source you linked, it returns the same error.

Revision history for this message
Best Mark Rijckenberg (markrijckenberg) said :
#3

OK, I believe the following workaround will solve your issue:

https://bitbucket.org/anthony_tuininga/cx_freeze/issue/32/cant-compile-cx_freeze-in-ubuntu-1304

So you need to replace the following line in setup.py:

https://bitbucket.org/anthony_tuininga/cx_freeze/src/d9461c3d4ff5c91f0405e1e5993b18bbdc0390aa/setup.py?at=default#cl-79

with this line:

if True:

So the line

            if not vars.get("Py_ENABLE_SHARED", 0):

should be changed to

if True:

Revision history for this message
Max D (maxdesp) said :
#4

That indeed solved my problem !

Thank you very much

Revision history for this message
Max D (maxdesp) said :
#5

Thanks Mark Rijckenberg, that solved my question.