This is just a variation of the most vexing parse: mo3
and mo4
are function declarations rather than object definitions. You can fix the problem using
MyObject mo3 {string(s2)};
MyObject mo4 {string(argv[0])};
or
MyObject mo3 ((string(s2)));
MyObject mo4 ((string(argv[0])));
or
MyObject mo3 = MyObject(string(s2));
MyObject mo4 = MyObject(string(argv[0]));
or ...