You can't directly run .cpp files, you'll have to compile them first. Probably as part of a package, in a catkin workspace.