We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am in Linux Mint 18 (base on Ubuntu 16.04), and I try the code in Page 27 which is
gcc $(python-config --cflags) $(python-config --ldflags) ./irrationals.c
gcc raise dozens of error like Undefined reference to ‘Py_Initialize’, when I change code to
Undefined reference to ‘Py_Initialize’
gcc $(python-config --cflags) ./irrationals.c $(python-config --ldflags)
Everything works well. So is it a version specific bug?
Python v 2.7.12 Cython v 0.24.1 gcc v 5.4.0 (20160609)
The text was updated successfully, but these errors were encountered:
@NKUCodingCat Indeed there are some messy things in the book that don't make any sense.
In case you are still interested in generating a standalone executable, run:
gcc -O2 irrationals.c -o irrationals $(python-config --libs --cflags --ldflags)
Your executable will be big, at least on my system was 13MB and I had to run strip --strip-all irrationals to reduce it down to 3.1MB.
13MB
strip --strip-all irrationals
3.1MB
Sorry, something went wrong.
No branches or pull requests
I am in Linux Mint 18 (base on Ubuntu 16.04), and I try the code in Page 27 which is
gcc $(python-config --cflags) $(python-config --ldflags) ./irrationals.c
gcc raise dozens of error like
Undefined reference to ‘Py_Initialize’
, when I change code togcc $(python-config --cflags) ./irrationals.c $(python-config --ldflags)
Everything works well. So is it a version specific bug?
Python v 2.7.12
Cython v 0.24.1
gcc v 5.4.0 (20160609)
The text was updated successfully, but these errors were encountered: