add extern to global vars

fix compilation with Objective-C++ code