Advertisement

SWIG + Python error: TypeError: Expected a pointer

Started by August 14, 2004 11:31 AM
0 comments, last by Fruny 20 years, 3 months ago
Hopefully this is the right forum for this. I'm trying to wrap a class with SWIG. The class has a number of virtual functions, which are overridden in Python.

class Application {
public:
     void run();
     void stop();
};


So in Python I have:

class MyApp(g.Application):
	_format = None
	
	def __init__(self):
		print("Initialising app")

	def run(self):
		g.Application.run(self)
		pass

app = MyApp()
app.create()
app.run()


When the Python run() function executes, I get:

Traceback (most recent call last):
  File "test.py", line 37, in ?
    app.run()
  File "test.py", line 24, in run
    g.gzApplication.run(self)
  File "D:\Development\swig\g.py", line 52, in run
    def run(*args): return _g.Application_run(*args)
TypeError: Expected a pointer



I'm really not sure how to fix this. Any help greatly appreciated. Thanks Edit: Oh man! Can't believe I posted this into the wrong forum! Please move this into the Scripting forum. Thanks!
---------------------http://www.stodge.net
Moved
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement