try to use extern for functions in cpp