title: How can I change entry point for a mach-o executable for a c++ file?
body: <p>I am trying to write a c++ program without main. Is it possible to change the entry point of a mach-o executable to a custom function (other than <code>main()</code>)?</p>
  
  <p>If not, then, is it possible to wrap <code>main</code> to call my version of main before the actual C <code>main</code> is called?</p>
  
  <p>Edit:</p>
  
  <p>I want to my custom function to call the C <code>main</code>. If I gave it a constructor attribute or added it to ctor list then <code>main</code> will be called twice. I do not want that to happen.</p>
  
  <p>P.S I'm building executables in Mac OS X High Sierra with clang version 9.1.0</p>