Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem on your Mac is that you're compiling code that uses various frameworks, and you're not linking those frameworks. <code>_CFRelease</code> comes from CoreFoundation, <code>_CGEventCreate</code> from Quartz, etc. </p> <p>So, you can't just write <code>gcc mouse.c</code>. If you write, say, <code>gcc mouse.c -framework CoreFoundation</code>, you'll see some of the errors go away. If you add all of the right flags, you'll see all of them go away. </p> <p>On the Mac, presumably your <code>mouse.c</code> (or a header it uses) already includes the header files from those frameworks, or it wouldn't have even compiled, so you wouldn't have even gotten those linker errors. In that case, it's pretty easy to guess which frameworks you need to include: <code>#include &lt;CoreFoundation/CoreFoundation.h&gt;</code> means you need <code>-framework CoreFoundation</code>.</p> <p>Alternatively, you can just search Apple's developer documentation for each of the functions that fails; it will tell you, at the top of each page, which framework the missing function is in.</p> <p>There are probably other things you want to include. For example, if you want to distribute a binary, rather than source that each user has to build, you probably want to build against an SDK, rather than against the local files.</p> <hr> <p>But you're going to have the exact same problem on every other platform, so you're going to have to solve it there as well. And other platforms don't have frameworks; there's no obviously one-to-one mapping between header files and <code>-l</code> libraries on linux. </p> <p>Obviously <code>autopy</code> has already solved this problem, so its setup.py/configure/Makefile/whatever will already tell you all the things you need to link to on each platform (although it may include a whole bunch of other stuff you <em>don't</em> need).</p> <hr> <p>The last error is a little different. It's complaining that you haven't defined a <code>main</code> function. Every C program has to have a <code>main</code> function. (If you were trying to build a static or shared library instead of a program, you have to tell GCC to do that.)</p> <hr> <p><a href="http://pastebin.com/yVG12cy8" rel="nofollow">Here</a> you can see a version hacked up to work on OS X.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload