|Do you know where your variables are?|
Inline::C code doesn't work, but the C code doesby mikfire (Deacon)
|on Dec 28, 2001 at 23:17 UTC||Need Help??|
mikfire has asked for the
wisdom of the Perl Monks concerning the following question:
I have posted this question to the inline mailing list, but haven't seen any response. I thought I would try my fellow monks to see if they could offer a clue.
I have been playing with Inline::C, trying to wrap an API so I could access it via perl. I have read the docs for Inline::C and explored the cookbook enough to figure out what I needed to do. I have been also able to get the examples contained within the cookbook working.
I wrote my code and, after getting rid of several stupid typos ( I am still trying to convince my fingers to stop adding a "$" in front of variable names :), the code compiled but returned an error. I worked at it for a little while and then decided to extract the C code, write a simple main() and see what happened.
It compiled, ran and returned without the error.
I am now very confused. I am dead certain I have missed something very silly - this is the first time I have tried to use Inline and my three previous attempts at using XS all failed
This is the code:
And this is the main() I wrote to test the C code directly:
If anybody could give me a pointer, I would appreciate it to no end. Again, I am quite certain this is my mistake but I really have no idea how to approach it.