Benches macOS

3

How to run a .o file?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I compiled a .o file with gpc, but can't seems to run it. What is the terminal command to run a .o file? Or can a .o even be executed?

3 replies

Sign in or join Beachball Help to reply.

  1. 0

    Camelot

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    A .o file is an object file - the output of the compiled source code. It cannot be run directly. It needs to be linked with the rest of the code/libraries/whatever to make a full app (most applications are the combination of multiple source files, each of which has a corresponding .o file, and none of which can run standalone).

    The linking is usually part of the make process, which implies that you're not following the normal practice of building your app. How are you invoking your compile?

  2. 0

    Nicholas Quirk

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    gpc -c filename.pas

  3. 0

    Nils C. Anderson

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Try using just

    gpc -o fileanme filename.pas

    this will give you a binary named "filename" that is runnable.