Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: pysfml2-cython building problems  (Read 6469 times)

0 Members and 1 Guest are viewing this topic.

PhiLLe

  • Newbie
  • *
  • Posts: 36
    • View Profile
pysfml2-cython building problems
« on: May 16, 2011, 10:21:15 pm »
Hi!

I have some problems with building pysfml2-cython with mingw32 on windows. I am using Python27.

My building log (--compiler=mingw32 is default):
Code: [Select]
C:\Users\Philipp\Documents\C++\pysfml2-cython>python setup.py build_ext --inplac
e
running build_ext
cythoning sf.pyx to sf.cpp
building 'sf' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files\CodeBlocks\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ic:\Py
thon27\include -Ic:\Python27\PC -c sf.cpp -o build\temp.win32-2.7\Release\sf.o
sf.cpp: In function 'PyObject* __pyx_pf_2sf_11SoundBuffer_7samples___get__(PyObj
ect*)':
sf.cpp:7838: warning: comparison between signed and unsigned integer expressions

sf.cpp: In function 'void __Pyx_RaiseArgtupleInvalid(const char*, int, Py_ssize_
t, Py_ssize_t, Py_ssize_t)':
sf.cpp:38407: warning: unknown conversion type character 'z' in format
sf.cpp:38407: warning: format '%s' expects type 'char*', but argument 5 has type
 'Py_ssize_t'
sf.cpp:38407: warning: unknown conversion type character 'z' in format
sf.cpp:38407: warning: too many arguments for format
sf.cpp: In function 'void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t)':
sf.cpp:38625: warning: unknown conversion type character 'z' in format
sf.cpp:38625: warning: format '%s' expects type 'char*', but argument 3 has type
 'Py_ssize_t'
sf.cpp:38625: warning: too many arguments for format
sf.cpp: In function 'void __Pyx_RaiseTooManyValuesError(Py_ssize_t)':
sf.cpp:38633: warning: unknown conversion type character 'z' in format
sf.cpp:38633: warning: too many arguments for format
sf.cpp: In function 'PyObject* __pyx_pf_2sf_5Image_14get_tex_coords(PyObject*, P
yObject*)':
sf.cpp:15063: warning: '__pyx_v_p' is used uninitialized in this function
writing build\temp.win32-2.7\Release\sf.def

All this should be okay even there are some warnings. But then:
Code: [Select]
C:\Program Files\CodeBlocks\MinGW\bin\g++.exe -mno-cygwin -mdll -static --entry
_DllMain@12 --output-lib build\temp.win32-2.7\Release\libsf.a --def build\temp.w
in32-2.7\Release\sf.def -s build\temp.win32-2.7\Release\sf.o -Lc:\Python27\libs
-Lc:\Python27\PCbuild -lsfml-graphics -lsfml-window -lsfml-audio -lsfml-system -
lpython27 -lmsvcr90 -o C:\Users\Philipp\Documents\C++\pysfml2-cython\sf.pyd
g++: build\temp.win32-2.7\Release\libsf.a: No such file or directory
error: command 'g++' failed with exit status 1

I don't get this. Shouldn't it build a file called libsf.a?

Can somebody help?

Chèvre

  • Newbie
  • *
  • Posts: 20
    • View Profile
pysfml2-cython building problems
« Reply #1 on: May 19, 2011, 07:13:22 pm »
The final command you have there is different from mine.
Code: [Select]
g++ -mno-cygwin -shared -s build\temp.win32-2.7\Release\sf.o build\temp.win32-2.7\Release\sf.def -LF:\python\271\libs -LF:\python\271\PCbuild -lsfml-graphics -lsfml-window -lsfml-audio -lsfml-system -lpython27 -lmsvcr90 -o sf.pyd
This works for me.  No mention of libsf.a, and I don't think it creates one.
If you use this command make sure to alter the paths (esp. with the -LF switches)

EDIT: I don't know how relevant this is, but you seem to be using the MinGW install that came as part of Code::Blocks.  I haven't tried that, and I use a 'fresh', manual MinGW install with which I built an SFML 2 snapshot from Git.
If you want, I could put together a zip file with the library files for Python.

PhiLLe

  • Newbie
  • *
  • Posts: 36
    • View Profile
pysfml2-cython building problems
« Reply #2 on: May 19, 2011, 08:40:24 pm »
Thanks for your response. I will try a "standalone" MinGW.

Another thing that confuses me is that I don't have a PCbuild dir.

Well. I will try some things and tell you how it worked out :)

Chèvre

  • Newbie
  • *
  • Posts: 20
    • View Profile
pysfml2-cython building problems
« Reply #3 on: May 19, 2011, 10:28:28 pm »
Quote from: "PhiLLe"
Thanks for your response. I will try a "standalone" MinGW.

Another thing that confuses me is that I don't have a PCbuild dir.

Well. I will try some things and tell you how it worked out :)


Well, I just took a peek and I don't have a PCbuild dir either... So I believe you'll be fine.