What do I need to do to link with xlib?

后端 未结 5 1917
陌清茗
陌清茗 2021-02-05 05:15

I am using GCC, what switches do I need to add to link with Xlib? After searching, all I could find was -lX11, but that gave me ld: library not found for -lX1

5条回答
  •  你的背包
    2021-02-05 05:48

    $ locate libX11
    /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.2.dylib
    /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.6.dylib
    /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.a
    /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libX11.dylib
    /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.2.0.dylib
    /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.6.dylib
    /Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/libX11.dylib
    /usr/X11/lib/libX11.6.2.0.dylib
    /usr/X11/lib/libX11.6.dylib
    /usr/X11/lib/libX11.dylib
    /usr/X11/lib/libX11.la
    

    I'd try

    gcc [...] -L/usr/X11/lib -lX11 [...]
    

    to set the search path for libraries.

提交回复
热议问题