[MingW] Undefined reference BUT find it with "nm"

I am trying to make SSL work with boost ASIO. I am on windows and using MingW 6.3.

I built OpenSSL 1.1, 1.0 and 0.8 with MingW when I try to link them to the project I always get different errors (depending on what is missing). Right now I am trying to make work OpenSSL 1.1.0g but I have those error even though I give manually the path to the libs with CMAKE.

Order of included libraries does matter, sometimes the same library need to be specified multiple times to work correctly. This is due to a "feature" of gnu linker which attempt to be "smart" and save time ( crap behaviour if you ask me )