I am including dyld.h to provide the function _NSGetExecutablePath() which will give the path to the executable for OS X 10.10.
But when including dyld.h in a C compile, I get the following error:
/usr/include/libkern/i386/_OSByteOrder.h:49:1: error: function definition is not allowed here.
The messages before the above are: In file included from testCode.c:11: In file included from /usr/include/mach-o/dyld.h:31: In file included from /usr/include/mach-o/loader.h:48: In file included from /usr/include/architecture/byte_order.h:38
It appears that dyld.h starts a train of includes that ends with an error. Does anyone know the requirements for using dyld.h or _NSGetExecutablePath()?