473,769 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SWIG wrapper/Python2.5c1 problem

If compiling a SWIG wrapper with MinGW 3.2.3 (Windows) get the
following compilation error:

pyprog_wrap.cxx : In function `int
SWIG_Python_Con vertFunctionPtr (PyObject*,
void**, swig_type_info* )':
pyprog_wrap.cxx :2051: invalid conversion from `const char*' to `char*'

Extract from wrapper:

/* Convert a function ptr value */

SWIGRUNTIME int
SWIG_Python_Con vertFunctionPtr (PyObject *obj, void **ptr,
swig_type_info *ty) {
if (!PyCFunction_C heck(obj)) {
return SWIG_ConvertPtr (obj, ptr, ty, 0);
} else {
void *vptr = 0;

/* here we get the method pointer for callbacks */
char *doc = (((PyCFunctionO bject *)obj) -m_ml -ml_doc); <--
error occurs here.

This must be caused by a change in Python.h, as there were no problems
with Python 2.3 or 2.4. SWIG version 1.3.29. Used -c++ and -shadow
options.

Can anyone reproduce this?

Andrew.

Aug 29 '06 #1
0 1301

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3619
by: Harish | last post by:
I am using Python2.3 version with SWIG-1.3.19 to access C++ interface provided by a DLL. Some of its function returns MFC class objects like CString , CMap. I tried to generate wrapper for these classes using SWIG by including respective header files in .i file. But it doesn't work. Swig reports hundreds parsing errors in MFC's file. Could you give me any directions.. Thank you in anticipation
0
1638
by: Andrew Collier | last post by:
hello, i am not sure whether this problem relates to swig, python or my c++ compiler. +please forgive me if this is inappropriately posted but i am sure that someone +on this list must have some good ideas. i have also sent i to the swig users list a couple of times but have not got any response so i am casting my net a little wider... i have been struggling with the following problem for a couple of days now. +specifically, i have a...
1
2206
by: Uwe Mayer | last post by:
Hi, I was trying to extend a Qt class in C++ and using this in my Python application. I got problems importing the python module: I was extending QListViewItem to QListViewItemNumeric. Then I used the following to generate the python extension: $ gcc -c -I/usr/include/qt3 -I/usr/include/python2.3 QListViewItemNumeric.cpp
3
1912
by: matteo | last post by:
Hi, I've got a problem with SWIG and Python2.2.I've installed the SWIG1.3.21 releaseunder QNX6.2 platform .I tried to make the exemple example.c (in the directory ../Swig/Exemple/python/simple) /* File : example.c */ #include <time.h> double My_variable = 3.0; int fact(int n) { if (n <= 1) return 1;
2
1910
by: superprad | last post by:
Hi I am trying to write a python wrapper for a C code I have using swig. when i try to compile the _wrap.c i get a bunch of these warnings and errors can anyone help Steps I followed : $swig -python test_hk.c this generates test_hk.py and test_hk_wrap.c then i compile it as $gcc -Wall -std=c99 test_hk.c test_hk_wrap.c -I/usr/include/python2.3/
1
2615
by: superprad | last post by:
Hi I am trying to write a python wrapper for a C code I have using swig. when i try to compile the wrap.c i get a bunch of these warnings and errors can anyone help $swig -python test_hk.c this generates test_hk.py and test_hk_wrap.c then i compile it as $gcc -Wall -std=c99 test_hk.c test_hk_wrap.c -I/usr/include/python2.3/
10
3208
by: Bart Ogryczak | last post by:
Hi, I´m looking for some benchmarks comparing SWIG generated modules with modules made directly with C/Python API. Just how much overhead does SWIG give? Doing profile of my code I see, that it spends quiet some time in functions like _swig_setattr_nondinamic, _swig_setattr, _swig_getattr.
0
1725
by: Eric von Horst | last post by:
Hi, we have a third-party product that has a C++ api on HP-UX. I would like be able to use the API in Python (as I remember Python is good at doing this). I have no experience with this so I Googled and tried to find some info on what I had to do.
3
5609
by: Paul Anton Letnes | last post by:
Hello guys, (related to previous thread on wrapping C/C++ in Python, trying the SWIG approach.) Trying to map a C++ class to python, one method for now. Running the following commands to "compile": -------------------------------------- #!/usr/bin/env bash
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10205
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8863
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.