Suppose we calculate our one-pole filter like so:
y = a0 * x + b1 * y_prev;
Then we can calculate the coefficients like so:
b1 = exp(-2.0 * M_PI * cutoff / sampleRate);
a0 = 1.0 - b1;
This is an approximate formula and the cutoff might be wrong for higher frequencies.
There is an exact formula that's a little more complicated but it will work better:
double omega = 2.0 * M_PI * cutoff / sampleRate;
double k = 2.0 - std::cos(omega);
b1 = k - std::sqrt(k * k - 1.0);
a0 = 1.0 - b1;