[swift-users] X11/Xlib linker error
Kelvin Ma
kelvin13ma at gmail.com
Sun May 21 14:48:51 CDT 2017
I’m trying to get Swift working with X11, and I keep getting this linker
error when I try to compile:
~/dev/cloudgen$ swift build -v
/usr/bin/lsb_release -r
/home/kelvin/devtools/swift-3.1-dev/usr/bin/swiftc --driver-mode=swift -I
/home/kelvin/devtools/swift-3.1-dev/usr/lib/swift/pm -L
/home/kelvin/devtools/swift-3.1-dev/usr/lib/swift/pm -lPackageDescription
/home/kelvin/dev/cloudgen/Package.swift -fileno 5
/home/kelvin/devtools/swift-3.1-dev/usr/bin/swift-build-tool -f
/home/kelvin/dev/cloudgen/.build/debug.yaml -v
'/home/kelvin/devtools/swift-3.1-dev/usr/bin/swiftc' -Xlinker
'-rpath=$ORIGIN' -g -L/home/kelvin/dev/cloudgen/.build/debug -o
/home/kelvin/dev/cloudgen/.build/debug/cloudgen '-lX11' -emit-executable
/home/kelvin/dev/cloudgen/.build/debug/cloudgen.build/main.swift.o
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:22: error: undefined
reference to 'XOpenDisplay'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:29: error: undefined
reference to 'XDefaultScreenOfDisplay'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:35: error: undefined
reference to 'XCreateSimpleWindow'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:38: error: undefined
reference to 'XSelectInput'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:41: error: undefined
reference to 'XMapWindow'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:47: error: undefined
reference to 'XNextEvent'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:52: error: undefined
reference to 'XFillRectangle'
/home/kelvin/dev/cloudgen/Sources/cloudgen/main.swift:53: error: undefined
reference to 'XDrawString'
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see
invocation)
<unknown>:0: error: build had 1 command failures
Here is the module.modulemap file I am using:
module X11 [system] {
module Xlib {
header "/usr/include/X11/Xlib.h"
}
module X {
header "/usr/include/X11/X.h"
}
link "X11"
}
Why is it always this difficult to get something to show up on a screen in
Swift…
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170521/d6999abb/attachment.html>
More information about the swift-users
mailing list