Skip to main content
gamedev.net
🔒 Locked

SWIG - Singleton template error

Started by supagu 2 replies 1.4k views
Original Post
supagu
supagu
Okay, im trying to get swig working (http://www.swig.org) so i can use my c++ dll in c#. Now, i have a singleton tempalte class, which i inlcude in to my i file which appears to compile fine (by compile i mean call swig.exe to generate wrappers). But when i go to include a class that uses the singleton it says: time.h(24): Warning(401): Nothing known about base class 'Singleton<Time >'. Ignored. time.h(24): Warning(401): Maybe you forgot to instantiate 'Singleton<Time >' using %template. BUT i have this line before my include (after i have included my singleton header): %template(TimeSingleton) Singleton<Time>; BUT this line generates the following warning: e:\SiphonGL2\Engine\SiphonGL2.i(31): Error: Template 'Singleton' undefined. any ideas how to fix it? it seems to not be including or finding my singleton class even though its included!
supagu
supagu
*bump* any one had this problem?
Gorg
Gorg
You say the headef file for singleton is included, but do you also have the header for Time?
supagu
supagu
okay fixed. I needed to put namespace around my %template methods

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.