Tuesday, September 19, 2006

SWIG and Overloaded Constructor

I have a class that has three constructors
class Foo {
Foo(const vector<const char *>* files, bool flag);
Foo(const char* file, bool flag);
Foo();
// ...
};
I am using typemap that maps between a list of strings and a const vector of const char*s. The typemap works fine for a function, but has trouble with the overloading. SWIG generates a wrapper function new_Foo() that dispatches based on the number and type of the arguments. The dispatch function checks for the exactly matching vector pointer using SWIG_ConvertPtr(). This check fails for the list of strings, so new_Foo() reports there is no matching constructor. The function that new_Foo() failed to call has the typemap code that converts the list of strings to the appropriate type.

What am I doing wrong?

Firefox parentlock

What do you do if Firefox refuses to start? The error dialog says "Firefox is already running but not responding." I've run into this problem a few times recently. There is no Firefox process running, but it won't start.

Solution: Delete the .parentlock file in one of the subdirectories of the .mozilla directory.

Apparently this fix is described in the Mozilla 1.5 troubleshooting guide, but a search with the text of the error message didn't produce any useful results.