SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 15th, 2003, 10:41 AM
Longhair Longhair is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 14 Longhair User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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 10:45 AM.

Reply With Quote
  #2  
Old June 15th, 2003, 02:38 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 18 m 50 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Converting python to C


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway