user71277: 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?

user71277: The problem was in libevent 2.0.22. It spoiled HTTP response from bitcoind every time. libevent 2.1.11 fixed this issue.

71277: <p>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:</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>I use bitcoin-cli without any options, just a: <code>bitcoin-cli.exe getbalance</code> or <code>bitcoin-cli.exe stop</code> </p>

<p>Here is my simple bitcoin.conf which I use with the both versions:</p>

<pre><code>server=1
rpcuser=username
rpcpassword=password
rpcallowip=127.0.0.1
rpcport=8332
datadir=F:\BitcoinData
</code></pre>

<p>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:</p>

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

<p>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?</p>
 71277: <p>The problem was in libevent 2.0.22. It spoiled HTTP response from bitcoind every time. libevent 2.1.11 fixed this issue.</p>
