title: Error including <vector> in Netbeans (C++)
body: <p>This is odd. I'm getting errors for including <code>&lt;vector&gt;</code>: (edit: works fine with <code>&lt;list&gt;</code> but I don't want to forsake vectors)</p>
  
  <pre><code>g++.exe    -c -g -MMD -MP -MF build/Debug/Cygwin-Windows/main.o.d -o build/Debug/Cygwin-Windows/main.o main.cpp
                   from MemoryScanner.h:11,
                   from main.cpp:10:
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h: In member function `void std::vector&lt;bool, _Alloc&gt;::_M_insert_range(std::_Bit_iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':
  In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/vector:72,
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h:522: error: expected unqualified-id before '(' token
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h: In member function `void std::vector&lt;bool, _Alloc&gt;::_M_fill_insert(std::_Bit_iterator, size_t, bool)':
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_bvector.h:823: error: expected unqualified-id before '(' token
                   from MemoryScanner.h:11,
                   from main.cpp:10:
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc: In member function `void std::vector&lt;_Tp, _Alloc&gt;::_M_fill_insert(__gnu_cxx::__normal_iterator&lt;typename _Alloc::pointer, std::vector&lt;_Tp, _Alloc&gt; &gt;, size_t, const _Tp&amp;)':
  In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/vector:75,
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc:307: error: expected unqualified-id before '(' token
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc: In member function `void std::vector&lt;_Tp, _Alloc&gt;::_M_range_insert(__gnu_cxx::__normal_iterator&lt;typename _Alloc::pointer, std::vector&lt;_Tp, _Alloc&gt; &gt;, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':
  /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/vector.tcc:384: error: expected unqualified-id before '(' tokenmake[2]: Leaving directory `/cygdrive/k/Documents and Settings/Administrator/My Documents/NetBeansProjects/MemScan'
  make[1]: Leaving directory `/cygdrive/k/Documents and Settings/Administrator/My Documents/NetBeansProjects/MemScan'
  
  make[2]: *** [build/Debug/Cygwin-Windows/main.o] Error 1
  make[1]: *** [.build-conf] Error 2
  make: *** [.build-impl] Error 2
  
  BUILD FAILED (exit value 2, total time: 1s)
  </code></pre>
  
  <p>The lines referenced:</p>
  
  <pre><code>#include "MemoryScanner.h" // main.cpp:10
  
  #include &lt;vector&gt; // MemoryScanner.h:12
  </code></pre>
  
  <p>Edit:</p>
  
  <p><strong>MemoryScanner.h</strong></p>
  
  <pre><code>#ifndef MEMORYSCANNER_H
  #define MEMORYSCANNER_H
  
  #include &lt;vector&gt;
  #include &lt;windows.h&gt;
  
  using namespace std;
  
  struct memblock {
      int address;
      int value;
  };
  
  class MemoryScanner {
  private:
      HANDLE _hProc;
      vector&lt;memblock&gt; _addresses;
  public:
      MemoryScanner(HANDLE hProc);
      MemoryScanner(const MemoryScanner&amp; orig);
      void scan(int value);
      void display();
      virtual ~MemoryScanner();
  };
  
  #endif  /* MEMORYSCANNER_H */
  </code></pre>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;windows.h&gt;
  #include "MemoryScanner.h"
  
  using namespace std;
  
  int main(int argc, char** argv) {
      HWND hWnd = FindWindow(0, "Calculator");
  
      if (hWnd == 0) {
          cout &lt;&lt; "Could not retrieve window handler" &lt;&lt; endl;
      } else {
          DWORD pid;
          GetWindowThreadProcessId(hWnd, &amp;pid);
          HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
  
          if (!hProc) {
              cout &lt;&lt; "Could not open process" &lt;&lt; endl;
          } else {
              MemoryScanner* scanner = new MemoryScanner(hProc);
  
              int value;
              cout &lt;&lt; "Enter value: ";
              cin &gt;&gt; dec &gt;&gt; value;
              scanner-&gt;scan(value);
              scanner-&gt;display();
          }
      }
  
      return 0;
  }
  </code></pre>