this is the one I based out of several years ago, so it does work. I found it to use a slow method to generate the hash hex-text, once you fix that, the rest is quick and fairly well done.
g++ -Wall -c md5.cpp // translates frac.cpp into object code, frac.o
g++ -Wall -c main.cpp // translates main.cpp into object code, main.o
g++ -Wall md5.o main.o -o sample // links object code files into an executable called "sample"
Can be simplified (at the cost of re-compiling object files) as:
g++ -Wall md5.cpp main.cpp -o sample
("-Wall" is the minimum warning level you should be compiling with. There are more such as -Wextra and -Wpedantic, to just name a few, which are also recommended.)
Ganado
If you're using an IDE, it depends on the particular IDE, but normally you simply add both .cpp to your project, and it knows how to handle the rest.