🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

SWIG + Python error: TypeError: Expected a pointer

Started by
0 comments, last by Fruny 19 years, 11 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
Advertisement
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