0

I'm using Cython for something - when I use it anywhere python is installed from like a package manager it works fine. So it works on all our dev boxes - but on the build machine - I've had to make python myself with this -

curl https://www.python.org/ftp/python/3.10.7/Python-3.10.7.tgz -o python.tgz
tar xf python.tgz
rm python.tgz
cd Python-3.10.7
./configure
make
make install

which has been working great for python, but now that I've thrown Cython into the mix - when I generate from cython

   gcc -O0 -o myapp \
      $(python3-config --ldflags --embed) \ 
      $(python3-config --includes --embed) \
      generated.c

I just get pages of errors saying _undefined reference to 'Py...' - it doesn't seem to be linking at all to the python libraries - even though I can see the -lpython3.10d - and I can see the libpython3.10d.a in that directory.

and as I said - on all the other machines - the same command works great - so I know Cython is correctly generating code and stuff - its the same where it works and doesn't work - there's either something wrong with the gcc line, or something wrong with my python install.

Darren Oakey
  • 2,894
  • 3
  • 29
  • 55
  • The dupe is a slightly different scenario but the same problem: the c-file must come first in the command line – ead Sep 26 '22 at 06:26
  • thanks - yep - that compiled - although now... oddly... the app doesn't work at all - gives me errors trying to import math with float not being a type - so it looks like it still hasn't _properly_ linked :( – Darren Oakey Sep 26 '22 at 08:06

0 Answers0