Benches Uncategorized

5

Error X11/Xlib.h: No such file or directory

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I'm trying to compile some C-code using gcc, and I keep getting the following error: "X11/Xlib.h: No such file or directory". I know that I need to "somehow" identify the Path information for these X11 lib's, etc, but I do not know HOW to do that. I tried adding path definitions to my .profile file - did not work. I have X11 installed, and supposedly I installed the SDK. Can anyone help me with this

5 replies

Sign in or join Beachball Help to reply.

  1. 0

    MrHoffman

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    If you're not sure if you have the SDKs, can you confirm you have the files under /Developer? Check for /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/X11

    I don't remember having to do anything special to get gcc to find these files.

    From what I've noted, the usual trigger seems to be that the X11SDK.pkg package wasn't installed.

    Typical PATH export is:

    export PATH="/bin:/sbin:/usr/bin:/usr/sbin"

    If you're working with Fink, there's a call to the following needed:

    . /sw/bin/init.sh

    See
    http://finkproject.org/doc/users-guide/install.php

    But I'd first make sure the X11 SDK was installed. I'd guess that is missing.

  2. 0

    Dale Ranta

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The X-Windows files are in "/usr/X11R6". If you do not have that directory, you do not have the X-Windows development package installed. For X-Windows, you use -I/usr/X11R6/include for the compile and "-L/usr/X11R6/lib -lX11" for your load command.

  3. 0

    Christopher Davis1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Many thanks! That was it. When I installed XCode, apparently the X11 SDk option was not clicked.

    Thanks again,

    CD

  4. 0

    Christopher Davis1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks for that hint as well. I took the easier route of installing the X11 SDK. The code compiled right away.

    CD

  5. 0

    Christopher Davis1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Great help with this! Many thanks again.