It's me answering my self. I found the solution in http://groups.google.com/group/comp.lang.python/browse_thread/thread/4d80df2e53dfa127/de87533c05d8021c?lnk=gst&q=Py_Initialize+undefined+reference#de87533c05d8021c It was the problem of gcc arguments order.