title: How do you declare an extern "C" function pointer
body: <p>So I have this code:</p>
  
  <pre><code>#include "boost_bind.h"
  #include &lt;math.h&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  
  double foo(double num, double (*func)(double)) {
    return 65.4;
  }
  
  int main(int argc, char** argv) {
    std::vector&lt;double&gt; vec;
    vec.push_back(5.0);
    vec.push_back(6.0);
    std::transform(vec.begin(), vec.end(), vec.begin(), boost::bind(foo, _1, log));
  }
  </code></pre>
  
  <p>And receive this error:</p>
  
  <pre><code>        return unwrapper&lt;F&gt;::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
  .............................................................^
  %CXX-E-INCOMPATIBLEPRM, argument of type "double (* __ptr64 )(double) C" is
            incompatible with parameter of type "double (* __ptr64 )(double)"
            detected during:
              instantiation of ...5 pages of boost
  </code></pre>
  
  <p>So this error is because 'log' is extern "C"'d in math.h</p>
  
  <p>I was wondering how to declare my function pointer argument in foo() so it handles extern "C"'d functions.</p>