Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the process gone through during Objective-C compilation
    primarykey
    data
    text
    <p>I'm currently having some linker problems when trying to compile an Objective-C program and think that the reason why I can't figure out the issue may be due to ignorance as to the compiler process.</p> <p>Would it be possible for somebody to give me an overview of the steps taken during compilation?</p> <p>This is as I currently understand the process:</p> <ol> <li><p>The compiler copies the contents of any included .h files into the file that it was defined in. The compiler does not keep track of whether a .h file has already been included, so it may be included within a project multiple times.</p></li> <li><p>Any .m files are compiled to C equivalent code (which are in turn compiled to object code).</p></li> <li><p>The linker produces links between the declarations made in the .h files and the appropriate functions within the object code. The appropriate functions are determined by looking for them in a .m file of the same name.</p></li> <li><p>The object files are connected together to form the executable, making sure that the main function is situated at the entry point of the executable. Any declarations are then presumably deleted to save space?</p></li> </ol> <p>Assuming this is correct (which it may not be), this would presumably mean that you should never #include .m files because you will likely end up with multiple method definitions which will cause the linker problems.</p> <p>Thanks for any illumination anybody can bring to this :).</p> <p>Cheers,</p> <p>Danny</p>
    singulars
    1. This table or related slice is empty.
    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. 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