transactions – Create a double sha256 block and trandaction

I have the same problem to create a double sha256 of transactions and blocks with C ++.

The hash block is created with the concatenation of this data,

version + previusBlock + MerkleRoot + TimeStamp + little bit + Meanwhile

In the hash block it is not necessary to include the raw transaction of all the data because they are included in the merkleRoot, right?

To create, the hash transaction is created with the concatenation of this data,
versionRawTransaction + exit of the transaction entry + scriptSing + entry of sequence transactions + Check the exit of the transaction + publicKeyScript + LockTime raw transaction

Or are the data included to save the variable structure? in this method

numberRawTransactions + versionRawTransaction + numbarTransactionInput + exit of the transaction entry + scriptLenght + scriptSing + entry of sequence transactions + numbarTransactionOutput + Check the exit of the transaction + publicKeyScriptLenght + publicKeyScript + LockTime raw transaction

Now I have tried to apply this theory in my C ++ program but I can not get the desired hash. Can you help me?

This is the code of my test.

                TEST (hash_test, first_test_double_sha_bit_genesi_block_bitcoin_crypolibrary)
{
// Init logger
FLAGS_minloglevel = 0;
FLAGS_logtostderr = true;
google :: SetLogDestination (google :: GLOG_WARNING, "/home/vincenzo/Github/SpyCblock/test/log/first_test_sha_not_on_bitcoin_protocolo.log");

chain version = "01000000";
string previusBlock = "0000000000000000000000000000000000000000000000000000000000";
string merkleRoot = "3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a";
string timeStamp = "29ab5f49";
string bit = "ffff001d";
string nonce = "1dac2b7c";

chain flow

sequence << version << previousBlock << merkleRoot << timeStamp << bit << nonce;


Bytes byte = asciiBytes (stream.str (). C_str ());
Sha256Hash shaHash = Sha256 :: getDoubleHash (byte.data (), byte.size ());

LOG (INFO) << "The hash genesi blocks the conversion with double sha256:" << shaHash.ToString ();
ASSERT_EQ (shaHash.ToString (), "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");


}

but I get this result 46f4d3f53251d05ab58a3f8925ce7023f2115dc38468ec78521c7d0e1dc7bd19

As I know practically nothing about cryptography in practice, I relied on this library in which I use this type of data here that makes the double sha256 find here

I'm sorry for my terrible English but I'm learning