This message was posted on behalf of Intel Corporation
The example you need to use is the one on: https://github.com/intel-iot-devkit/upm/tree/master/examples/c%2B%2B
This: https://github.com/intel-iot-devkit/upm/blob/master/src/hcsr04/hcsr04.cxx is the source used to generate the headers for this sensor, you don’t need to use this file unless you are building the library from scratch, but you are using the headers that are in the Eclipse IDE so it is not required.
Once you have the example on Eclipse, you need to add –lupm-hcsr04 in the linkers for Cross G++ Linker > Miscellaneous. Try with this and let us know if you still have problems, if you do please a screenshot of the errors you get under the problems tab.