title: Debug Assertion Failed! Expression: __acrt_first_block == header
body: <p>I am trying to test the dll which I wrote with GoogleTest and when I call one of the tests It throws me this error:</p>
  
  <p><img src="https://i.stack.imgur.com/35a8Z.png" alt="enter image description here"></p>
  
  <p>I have come to the conclusion that the problem is in assigning memory to vectors but I don't know how to resolve this as I am fairly new to C++ programming. The code is as follows:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#ArraysCPP11.h
  #ifdef ARRAYSCP11_EXPORTS
  #define ARRAYSCP11_API __declspec(dllexport)
  #else
  #define ARRAYSCP11_API __declspec(dllimport)
  #endif
  
  __declspec(dllexport) void removeWhiteSpaces(std::vector&lt;std::string&gt; v, std::vector&lt;std::string&gt; &amp;output);
  </code></pre>
  
  <pre class="lang-cpp prettyprint-override"><code>#ArraysCPP11.cpp
  void removeWhiteSpaces(std::vector&lt;std::string&gt; v, std::vector&lt;std::string&gt; &amp;output) { //odstranjevanje presledkov iz vector-ja (vsak drugi element je bil presledek)
      for (std::vector&lt;std::string&gt;::iterator it = v.begin(); it != v.end(); it++) {
          std::string buffer = *it;
          if (isdigit(buffer[0])){;
              output.push_back(*it);
          }
      }
  }
  </code></pre>
  
  <pre class="lang-cpp prettyprint-override"><code>#TestTemp.h
  
  template&lt;class T&gt; 
  class TestTemp
  {
  public:
     TestTemp();
     void SetValue(T obj_i);
     T GetValue();
     bool alwaysTrue();
     bool TestTemp&lt;T&gt;::formattingTest(std::string input, std::vector&lt;std::string&gt; realVector, std::vector&lt;std::string&gt; formattedInput);
  private:
     T m_Obj;
  };
  
  template&lt;class T&gt;
  inline bool TestTemp&lt;T&gt;::formattingTest(std::string input, std::vector&lt;std::string&gt; realVector, std::vector&lt;std::string&gt; formattedVector) {
  std::string input2 = input;
  //  std::vector&lt;std::string&gt; fResult;
  std::string first;
  std::string second;
  bool endResult = true;
  std::vector&lt;std::string&gt; end;
  //std::vector&lt;std::string&gt; result = split(input2, ' ');
  removeWhiteSpaces(formattedVector,end);
  std::vector&lt;std::string&gt;::iterator yt = realVector.begin();
  for (std::vector&lt;std::string&gt;::iterator it = end.begin(); it != end.end(); it++, yt++) {
      first = *it;
      second = *yt;
      if (first.compare(second) != 0) {
          endResult = false;
          break;
      }
  }
  return endResult;
  }
  </code></pre>
  
  <pre class="lang-cpp prettyprint-override"><code>   #ArraysCPP11-UnitTest.cpp
  struct formattingTesting{
     //   formattingTesting* test;
     std::string start;
     std::vector&lt;std::string&gt; endResult;
     formattingTesting() {
     }
     explicit formattingTesting(const std::string start, const std::vector&lt;std::string&gt; endResult)
      : start{start}, endResult{endResult} 
     {
     }
  };
  
  struct fTest : testing::Test {
     formattingTesting* test;
     fTest() {
        test = new formattingTesting;
     }
     ~fTest() {
        delete test;
     }
  };
  
  struct format {
     std::string start;
     std::vector&lt;std::string&gt; end;
  };
  
  struct formTest : fTest, testing::WithParamInterface&lt;format&gt; {
     formTest() {
        test-&gt;start = GetParam().start;
        test-&gt;endResult = GetParam().end;
     }
  };
  
  TEST_P(formTest, test1) {
     bool endResult = true;
     TestTemp&lt;int&gt; TempObj;
     std::string first;
     std::string second;
     //std::string start ("1  2 3 4 5 6 7 8 9 10");
     //std::vector&lt;std::string&gt; end = { "1","2","3","4","5","6","7","8","9","10" };
     std::vector&lt;std::string&gt; start2 = { "1","","2","3","4","5","6","7","8","9","10" };
     std::string start = GetParam().start;
     std::vector&lt;std::string&gt; end = GetParam().end;
     bool result = TempObj.formattingTest(start,end,start2);      
     EXPECT_TRUE(result);
  }
  
  INSTANTIATE_TEST_CASE_P(Default, formTest, testing::Values(
     format{ "1", {"1"} },
     format{ " ", {} },
     format{ "1 2 3 4 5",{"1","2","3","4","5"} },
     format{ "1  2 3 4 5  6", {"1","2","3","4","5","6"} }
  ));
  
  
  int main(int argc, char** argv)
  {
     testing::InitGoogleTest(&amp;argc, argv);
     RUN_ALL_TESTS();
     return 0;
  }
  </code></pre>