Library is built wrong on OSX #7

Closed
carlor opened this Issue Apr 9, 2012 · 2 comments

Comments

Projects
None yet
3 participants

carlor commented Apr 9, 2012

Building a file which shows Hello World (hiworld.d) in Mac OS 10.7:

$ dmd hiworld.d -I'libX11' libX11/lib/libDX11-dmd.a 
ld: warning: ignoring file libX11/lib/libDX11-dmd.a, file was built for archive which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_XCloseDisplay", referenced from:
      __Dmain in hiworld.o
  "_XMapWindow", referenced from:
      __Dmain in hiworld.o
  "_D6deimos3X114Xlib6XEvent6__initZ", referenced from:
      __Dmain in hiworld.o
  "_XOpenDisplay", referenced from:
      __Dmain in hiworld.o
  "_RootWindow", referenced from:
      __Dmain in hiworld.o
  "_XDrawString", referenced from:
      __Dmain in hiworld.o
  "_DefaultScreen", referenced from:
      __Dmain in hiworld.o
  "_BlackPixel", referenced from:
      __Dmain in hiworld.o
  "_DefaultGC", referenced from:
      __Dmain in hiworld.o
  "_WhitePixel", referenced from:
      __Dmain in hiworld.o
  "_XFillRectangle", referenced from:
      __Dmain in hiworld.o
  "_XCreateSimpleWindow", referenced from:
      __Dmain in hiworld.o
--- errorlevel 1
  "_XSelectInput", referenced from:
      __Dmain in hiworld.o
  "_XNextEvent", referenced from:
      __Dmain in hiworld.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Contributor

MartinNowak commented Apr 9, 2012

You need to link against libX11 too (-L-lX11).

Contributor

CyberShadow commented Mar 29, 2016

I'm guessing this is now solved or no longer relevant, thus closing, but let me know if this should be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment