0

This latest programming project of mine has pushed some boundaries I haven't crossed before; mainly, I've begun doing some serious C programming. Stack Overflow's users have been exceptionally helpful so far, so I will draw on your knowledge again. I want to write some bindings C function bindings (drawing pixels to the screen using SDL) for Python, and I am, once again, stuck on a compiler error.

This line:

Py_InitModule3("ezpix", ezpix_methods, "ezpix extension");

Gives me this error:

POLINK: error: Unresolved external symbol '_Py_InitModule3'.
POLINK: fatal error: 1 unresolved external(s).

I find it odd that it says _Py_InitModule3 when I put Py_InitModule3, is the syntax parser adding in an underscore or something? I'm using Pelles C for Windows, and the rest of my code (including the scarier looking bits) have compiled just fine.

2
  • You do know that pygame is an SDL binding, right? Commented Aug 19, 2011 at 19:19
  • Really? Huh. It goes WAY too slow for what I'm doing. I looked at the pygame source and there is a bunch of garbage for setting pixels that must REALLY bog it down. What I'm trying seems like it should work MUCH faster, since I'll just be passing arrays of pixel values to the drawing function. Commented Aug 19, 2011 at 19:22

1 Answer 1

1

That's the mangled name of the function, which isn't found in the library because it's a macro from modsupport.h:

#define Py_InitModule3(name, methods, doc) \
    Py_InitModule4(name, methods, doc, (PyObject *)NULL, \
                   PYTHON_API_VERSION)

modsupport.h gets included by Python.h.

Sign up to request clarification or add additional context in comments.

1 Comment

What does this mean and how do I fix it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.