473,326 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

python and swig

8
Hi,
I'm using python and swig. I'm a begginner and after generating the .cpp and wrap file from swig the compilation of wrap file is giving problem taht can not include python.h, though it is present there in Lib folder of python.What should I do for compiling and creating a object file, I'm having Windows xp operating system.Plz reply me soon, its urgent.

Ajit Pandey
Feb 17 '07 #1
11 2035
bartonc
6,596 Expert 4TB
Hi,
I'm using python and swig. I'm a begginner and after generating the .cpp and wrap file from swig the compilation of wrap file is giving problem taht can not include python.h, though it is present there in Lib folder of python.What should I do for compiling and creating a object file, I'm having Windows xp operating system.Plz reply me soon, its urgent.

Ajit Pandey
Are you using MS VC++ compiler? If not, which one?
Feb 17 '07 #2
itajit
8
Are you using MS VC++ compiler? If not, which one?

Yes VC++ 6.0, but will it be runnable with turbo command promt?
Feb 17 '07 #3
bartonc
6,596 Expert 4TB
Yes VC++ 6.0, but will it be runnable with turbo command promt?
You should have a folder some place like "D:\swigwin-1.3.29\Examples\python" Start with the "simple" project. This project will fill in the command line for you. After you have the project to a point where it will compile, you can copy the command to your favorite prompt.
Feb 17 '07 #4
itajit
8
You should have a folder some place like "D:\swigwin-1.3.29\Examples\python" Start with the "simple" project. This project will fill in the command line for you. After you have the project to a point where it will compile, you can copy the command to your favorite prompt.
The error is encountered that "Can not open include file Python.h".
That is the problem I'm facing from 2 days.
Feb 17 '07 #5
bartonc
6,596 Expert 4TB
The error is encountered that "Can not open include file Python.h".
That is the problem I'm facing from 2 days.
In the Project Properties dialog
in the C/C++|General section
in Additional Include Directories
I have "$(PYTHON_INCLUDE)", but you could put your path to python24\include.

In the Project Properties dialog
in the Linker|Input section
in Additional Dependancies
I have "$(PYTHON_LIB)", but you could put your path to python24\lib.
Feb 17 '07 #6
itajit
8
In the Project Properties dialog
in the C/C++|General section
in Additional Include Directories
I have "$(PYTHON_INCLUDE)", but you could put your path to python24\include.

In the Project Properties dialog
in the Linker|Input section
in Additional Dependancies
I have "$(PYTHON_LIB)", but you could put your path to python24\lib.
Hi, thanx,Now that error is been resolved but a new error is genereted
That error is in the include file <IOSFWD>. Saying that ' {' is expected, but I have checked all the braces are properly placed.Error numbers are C2143 and C2059. plz guide yar, its urgent and important.

bye
Feb 19 '07 #7
bartonc
6,596 Expert 4TB
Hi, thanx,Now that error is been resolved but a new error is genereted
That error is in the include file <IOSFWD>. Saying that ' {' is expected, but I have checked all the braces are properly placed.Error numbers are C2143 and C2059. plz guide yar, its urgent and important.

bye
I suggest that you start small, (say) with the simple example, and add your files and/or declarations to it until you get the error. Then you'll know where the error is comming from.
Feb 19 '07 #8
itajit
8
I suggest that you start small, (say) with the simple example, and add your files and/or declarations to it until you get the error. Then you'll know where the error is comming from.

Actually the .c and wrap.c file is compiled successfully but now how to link them? I have tried the ld command and one other alternative but it is giving an error that undefined function to each function.What should I do now and how?
Feb 20 '07 #9
bartonc
6,596 Expert 4TB
Actually the .c and wrap.c file is compiled successfully but now how to link them? I have tried the ld command and one other alternative but it is giving an error that undefined function to each function.What should I do now and how?
I used the example project to meet my needs. The project takes care of all the gory details. I recomment that you do the same.
Feb 20 '07 #10
itajit
8
I used the example project to meet my needs. The project takes care of all the gory details. I recomment that you do the same.
Ya I too using example project, But tell me how to link two object file genereted by swig to create .dll file.
Feb 20 '07 #11
bartonc
6,596 Expert 4TB
Ya I too using example project, But tell me how to link two object file genereted by swig to create .dll file.
The dll should be in \Release folder.
Feb 20 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Gary | last post by:
Hi- I've been searching the web for a while and I've been unable to find a way to access c data objects in python without using SWIG. I can do methods just fine but I can't access variables. ...
0
by: Jon Moldover | last post by:
Hi, I'm using Python in my win32 app by linking to the python23.dll. I'm trying to expose some c++ code in my app to Python so I can make application calls from Python scripts (according to the...
7
by: Bo Peng | last post by:
Dear Python group: I am planning on an application that involves several complicated C++ classes. Basically, there will be one or two big data objects and some "action" objects that can act on...
13
by: Roy Smith | last post by:
I've got a C library with about 50 calls in it that I want to wrap in Python. I know I could use some tool like SWIG, but that will give me a too-literal translation; I want to make some...
1
by: Arthur Chereau | last post by:
Hi, I'm trying to setup viewcvs to work with subversion 1.2.0 on Linux with Python 2.4.1. The last viewcvs (from CVS) needs subversion python bindings. I installed swig and built subversion from...
0
by: Claudio Grondi | last post by:
What is the current status of Python OpenCV interface i.e. the opencv module? \OpenCV\samples\python\contours.py gives following ERROR: OpenCV Python version of contours Traceback (most recent...
1
by: Java and Swing | last post by:
I am trying to wrap some C code I have. Currently I have something like... defs.h ----------- typedef unsigned long MY_DIGIT; myapp.c ------------- void MakeDigits(MY_DIGIT digits) {
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
6
by: matey | last post by:
I am have version 2.3.4. I want to write a python script to access a secure HTTPS. I tried the following: import urllib urllib.urlopen("https://somesecuresite.com") s = f.read() f.close()
0
by: Basha J P M | last post by:
I am beginner in python. I am working through the tutorial examples from http://www.swig.org/ and have run into some problems. I took the following command instructions from the tutorial on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.