#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    14
    Rep Power
    0

    Converting python to C


    In my attempts to expand my little programming knowledge, I thought about converting python to c++ because the bot I have have needs multi-threading capiblities to reach its full potential...

    Anyways, I found PY2CMOD and successfully converted a SAMPLE PROGRAM with no problems.

    Now when I try to compile the test.c file with Borland 5.01 I end up getting the following errors:

    Info :Compiling D:\TEST\test.c
    Error: unicodeobject.h(118,23):Unable to open include file 'wchar.h'
    Error: longobject.h(48,61): Declaration was expected
    Error: longobject.h(49,29):Storage class 'extern' is not allowed here
    Error: longobject.h(49,78):'PyLong_FromUnsignedLongLong' is not a parameter
    Error: longobject.h(50,28):Storage class 'extern' is not allowed here
    Error: longobject.h(50,46):, expected
    Error: longobject.h(51,63): Declaration syntax error

    The main thing that is stumping me is the 'wchar.h' because the unicodeobject.h (from the python files) wants to import it and it doesn't exist.

    Can someone shed some light on this for me?

    Thx

    (edited for 's)
    Last edited by Longhair; June 15th, 2003 at 11:45 AM.
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    We'll judging by the error you recieved the .h files arn't accessable from your c compiler. does py2cmod make any other files or just test.c? Also, py2cmod seems to have produced a syntax error in several places.. you could go through and correct it manually but it's a bit of a b*tch, especially if you don't know much c.

    I'd try compiling it with another compiler. I currently use devC++ which you can get for free from sourceforge.net. I have the same problem when trying to compile Jython sources to a .class files. Other than that I dont know what else to suggest sorry.

    Anyway hope this helps,

    Good luck with this Longhair,
    Mark.

IMN logo majestic logo threadwatch logo seochat tools logo