endian.h not found on mac osx

余生长醉 提交于 2019-11-27 22:00:26

Xcode on OS X does not install the command-line tools by default. Depending on your Xcode and OS X version you have to

  • install the command line tools from the Xcode Preferences->Downloads window, or
  • execute xcode-select --install from the Terminal command-line.

This will also install the "/usr/include" files, including "/usr/include/machine/endian.h".

For Xcode 10 and later, see Camille G.'s answer.

I just used <machine/endian.h> rather than <endian.h>.

It works.

As said in the first comment, endian.h is in /usr/include/machine/ folder.

Download and install the Command Line Tools (macOS 10.X) for XCode 10.X from Apple : https://developer.apple.com/download/more/

Since MacOS 10.14 this will not create anymore the /usr/include folder. This require the installation of an extra package that you could find on your computer after having installed the command-line tools :

/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

In fact, you should import "Endian.h" check your disk manager, maybe your disk is case sensitive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!