If you don't need too-high-quality RNG, you can implement it yourself as a one-liner according to description here: https://en.wikipedia.org/wiki/Linear_congruential_generator Linear congruential gens got quite a bad name recently, but for many practical purposes they're fine.
As long as you're careful with using only guaranteed-size types (uint32_t etc.), you should be fine on all the platforms.
If you need better-quality RNG, once again you can implement Mersenne Twister (https://en.wikipedia.org/wiki/Mersenne_Twister) yourself, but it will be more complicated.
Yet another way is to use AES (or any other block cypher for that matter, like Chacha20) in CTR mode (using some predefined key) as your PRNG; it will be of the best known (cryptographic) quality :-). It won't take much coding on your side, but you'd need to link AES implementation (they're widely available).
EDIT: example pseudo-code to illustrate crypto-based PRNG:
class CryptoBasedPRNG {
uint128_t key;
uint128_t count;
CryptoBasedPRNG(whatever-type seed) {
//derive key and initial counter from seed
// we'll be using SHA256, but any other split should do (like odd bits/even bits of seed)
uint256_t sha = sha256(seed);
key = low_128bits(sha);
count = high_128bits(sha);
}
uint128_t random_128_bits() {
count += 1;//with wraparound
return aes128(key,count);//encrypting 'count' as input data for aes128 (in ECB mode, if anybody asks about mode at this point)
}
}
Rather easy and very random.
boost::mt19937
should provide consistent results, can you provide the a Minimal, Complete, and Verifiable example – Adames