title: Android JNI print int64_t to file
body: <p>I am trying to use JNI code to print Android sensor timestamps to a file.</p>
  
  <p>The timestamps are <a href="https://developer.android.com/ndk/reference/struct_a_sensor_event.html" rel="nofollow">defined as</a> <code>int64_t</code>.</p>
  
  <p>The line to print the timestamp is:</p>
  
  <pre><code>fout&lt;&lt;timestamp&lt;&lt;std::endl;
  </code></pre>
  
  <p>Where fout is an open file stream in output mode.</p>
  
  <p>When I try to compile, the following error results:</p>
  
  <blockquote>
    <p>ambiguous overload for 'operator&lt;&lt;' (operand types are 'std::ofstream {aka std::basic_ofstream >}' and 'int64_t {aka long long int}')   XXX.cpp /YYY/jni    line ZZZ    C/C++ Problem</p>
  </blockquote>
  
  <p>I thought I would make an MWE for this using standard C++:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdint&gt;
  
  int main(){
    int64_t a;
    std::cin&gt;&gt;a;
    std::cout&lt;&lt;a&lt;&lt;std::endl;
  }
  </code></pre>
  
  <p>But this compiles without an issue, which makes me think the problem is somehow in the way Eclipse compiles the code.</p>
  
  <p>I am inside Eclipse 3.8.1. My default compiler is GCC 4.9.2.</p>