Unable to access PWM from userspace on BBB

I am new to Beaglebone black & embedded linux programming. I am looking for C/C++ library for PWM.

I am compiling the C++ library given by SaadAhmad but i am unable to run it. when i am compiling with arm-angstrom-linux-gnueabi-gcc, i am getting errors. And when i am compiling with g++ -c command, it is giving no errors, but unable to execute the binary file.

Any body got a C/C++ library for PWM & ADC.