title: How to use std::vector or other container in cgo of golang?
body: <p>I want to malloc large number of objects in to memory.(about 100 million objects) because the gc of golang is not effective enough,so i need to use c/c++ to malloc memory and use std::vector to hold objects.
  this is my code,i want use std container in cgo:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  /*
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;vector&gt;
  
  
  using namespace std;
  
  void dosome(){
      vector&lt;int&gt; ivec;   // empty vector
      for (vector&lt;int&gt;::size_type ix = 0; ix != 10; ++ix)
          ivec[ix] = ix; // disaster: ivec has no elements
  }
  
  */
  // #cgo LDFLAGS: -lstdc++
  import "C"
  
  //import "fmt"
  func main() {
  
      C.dosome()
  
      var input string
      fmt.Scanln(&amp;input)
  }
  </code></pre>
  
  <p>and have error message below:</p>
  
  <pre><code>go run stddemo.go 
  # command-line-arguments
  ./stddemo.go:13:10: fatal error: 'vector' file not found
  #include &lt;vector&gt;
       ^
  1 error generated.
  </code></pre>
  
  <p>how can i set the include path or is there another idea?</p>