Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:03:38+00:00 2026-05-30T08:03:38+00:00

If you compile a program in say, C, on a Linux based platform, then

  • 0

If you compile a program in say, C, on a Linux based platform, then port it to use the MacOS libraries, will it work?

Is the core machine-code that comes from a compiler compatible on both Mac and Linux?

The reason I ask this is because both are “UNIX based” so I would think this is true, but I’m not really sure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:03:40+00:00Added an answer on May 30, 2026 at 8:03 am

    No, Linux and Mac OS X binaries are not cross-compatible.

    For one thing, Linux executables use a format called ELF.

    Mac OS X executables use Mach-O format.

    Thus, even if a lot of the libraries ordinarily compile separately on each system, they would not be portable in binary format.

    Furthermore, Linux is not actually UNIX-based. It does share a number of common features and tools with UNIX, but a lot of that has to do with computing standards like POSIX.

    All this said, people can and do create pretty cool ways to deal with the problem of cross-compatibility.

    EDIT:

    Finally, to address your point on byte-code: when making a binary, compilers usually generate machine code that is specific to the platform you’re developing on. (This isn’t always the case, but it usually is.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question: Is it possible to compile a program on linux using a .dll file?
I'm a noob to how shared libraries work on linux. I am trying to
see if i have made one c program in c on linux machine now
I have started using M-x compile to compile programs in say, C. What is
I'm trying to compile a program called ngrep, and when I ran configure, things
I was trying to compile a program using an external compiled object coreset.o. I
How do I save and compile a program in Befunge-93? What file extension do
Is there a way to log the commands, make invokes to compile a program?
I'm trying to compile a simple program, with #include <gtkmm.h> The path to gtkmm.h
I am trying to compile my C program in Ubuntu 9.10 (gcc 4.4.1). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.