So I am completely new to programming in C on a computer (I once compiled code in college, but that is it) so when I was trying to learn Cython I was hopeful I wouldn’t have to REALLY learn any C. Maybe I was too hopeful?
Anyway, i am doing the tutorial here and encountering issues with the generated C code. Namely, it is giving the following errors:
___pyx_pf_5queue_5Queue___dealloc__
queue.obj : error LNK2019: unresolved external symbol _queue_new referenced in function ___pyx_pf_5queue_5Queue___cinit__
\\Vs1\fs2\Operations\Software\VixarFiles_Dev\Playground\cython\tutorial and calgorithms src\queue.pyd : fatal error LNK1120: 2 unresolved externals
I don’t know where it is getting an “_” in front of those names, it must be writing them itself somewhere when it creates teh C code (it’s nowhere in my code). Any help or hints would be appreciated.
Possible causes of the problem:
– Ok, I didn’t follow the tutorial PERFECTLY. I haven’t built or installed the library, I simply threw the source code into the same folder as my python files (and named them differently to ensure it didn’t overwrite the *.c files). From what I did in C++ class, this should be fine. Is there any reason it might not be? If so, I have no clue how to build a C file normally.
I would like to know if anyone has any idea what I’m doing wrong or of a good steps I might take to find out how to solve it. Thanks!
It looks to me like your problem is not with knowing C as a language, but is related to getting the proper libraries in your path. When queue.obj is throwing an “unresolved external reference” error, it usually means that C code (that cython generates) calls some function from a library, but your build system can’t find the library. Sorry, but I am also new to cython, so I can’t rattle off the expected path for the _queue_new function.