Compiled version of bitcoind 0.18.1. "Could not connect to the server 127.0.0.1:8332" When I use the official installed bitcoind 0.18.1 everything works fine. I can use the bitcoin-cli with any comands and don't get any errors.
After that when I compiled 0.18.1 myself I can't use any bitcoin-cli comands and I get:


  error: Could not connect to the server 127.0.0.1:8332
  Make sure the bitcoind server is running and that you are connecting to the correct RPC port.


I use bitcoin-cli without any options, just a: bitcoin-cli.exe getbalance or bitcoin-cli.exe stop 

Here is my simple bitcoin.conf which I use with the both versions:

server=1
rpcuser=username
rpcpassword=password
rpcallowip=127.0.0.1
rpcport=8332
datadir=F:\BitcoinData


I compile it with MinGW-w64-i686-posix-sjlj on Win7 target platform and with boost 1.57, libdb 4.8.30, openssl 1.0.1, libevent 2.0.22 as a dependent libs. I tried to compile 0.16.1 verion with the same stack but error is a similar:


  error : couldn't connect to server : unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)


What is wrong with compiled version? I can't realise what I missed. The compilation went without any errors. May be I missed some ./configure options?
The problem was in libevent 2.0.22. It spoiled HTTP response from bitcoind every time. libevent 2.1.11 fixed this issue.