# Ld.gold: error: cannot open library

**URL:** <https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572>\
**Category:** Development\
**Created:** [March 11, 2021, 7:55am UTC](https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572 "2021-03-11T07:55:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergeyDi](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sergeyDi](https://forums.swift.org/u/sergeyDi)\
**Post date:** [March 11, 2021, 7:55am UTC](https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572/1 "2021-03-11T07:55:36Z")

</div>

```
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"

# swift --version
Swift version 5.1.5 (swift-5.1.5-RELEASE)
Target: x86_64-unknown-linux-gnu

# swift build -v                                                                                                                               
lsb_release -r                                                                                                                                                                                              
uname                                                                                                                                                                                                       
pkg-config --variable pc_path pkg-config                                                                                                                                                                    
/opt/swift/usr/bin/swiftc -sdk / -L/usr/lib/x86_64-linux-gnu -lssl -L/usr/lib/x86_64-linux-gnu -lcrypto -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lz -L/usr/lib/x86_64-linux-gnu -lcurl -L/us
r/lib/x86_64-linux-gnu -lssl -L/usr/lib/x86_64-linux-gnu -lcrypto -g -L /home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug -o /home/ubuntu/Home/Multipass/.build/x8
6_64-unknown-linux/debug/antiparsing -module-name appname -emit-executable -Xlinker '-rpath=$ORIGIN' @/home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug/name.product/O
bjects.LinkFileList -target x86_64-unknown-linux -L /opt/swift/usr/lib                                                                                                                                      
/usr/bin/ld.gold: error: cannot open /home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug/NIOPriorityQueue.build/PriorityQueue.swift.o: Operation not permitted                     
/usr/bin/ld.gold: error: cannot open /home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug/NIOTLS.build/ApplicationProtocolNegotiationHandler.swift.o: Operation not permitted       
/usr/bin/ld.gold: error: cannot open /home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug/NIOTLS.build/NIOTLS.swiftmodule.o: Operation not permitted                                
/usr/bin/ld.gold: error: cannot open /home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug/NIOTLS.build/SNIHandler.swift.o: Operation not permitted                                  
/usr/bin/ld.gold: error: cannot open /home/ubuntu/Home/Multipass/.build/x86_64-unknown-linux/debug/NIOTLS.build/TLSEvents.swift.o: Operation not permitted                                   

```

Issue happens after migrating from 5.0.4 to 5.1.5

---

<div class="post-metadata">

**Author:** ![drexin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/drexin/32/7573_2.png) [@drexin](https://forums.swift.org/u/drexin)\
**Post date:** [March 11, 2021, 11:29pm UTC](https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572/2 "2021-03-11T23:29:58Z")

</div>

That looks like a file permission issue. What are the permissions and ownership for those files?

---

<div class="post-metadata">

**Author:** ![sergeyDi](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sergeyDi](https://forums.swift.org/u/sergeyDi)\
**Post date:** [March 12, 2021, 7:49am UTC](https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572/4 "2021-03-12T07:49:15Z")

</div>

```
# ls -l .build/x86_64-unknown-linux/debug/NIOPriorityQueue.build/
total 340
-rw-r--r-- 1 root root 4701 Mar 12 09:22 Heap.d
-rw-r--r-- 1 root root 107744 Mar 12 09:22 Heap.swift.o
-rw-r--r-- 1 root root 21330 Mar 12 09:22 Heap.swiftdeps
-rw-r--r-- 1 root root 356 Mar 12 09:22 Heap~partial.swiftdoc
-rw-r--r-- 1 root root 29420 Mar 12 09:22 Heap~partial.swiftmodule
-rw-r--r-- 1 root root 40528 Mar 12 09:22 NIOPriorityQueue.swiftmodule.o
-rw-r--r-- 1 root root 4728 Mar 12 09:22 PriorityQueue.d
-rw-r--r-- 1 root root 59544 Mar 12 09:22 PriorityQueue.swift.o
-rw-r--r-- 1 root root 11526 Mar 12 09:22 PriorityQueue.swiftdeps
-rw-r--r-- 1 root root 356 Mar 12 09:22 PriorityQueue~partial.swiftdoc
-rw-r--r-- 1 root root 25520 Mar 12 09:22 PriorityQueue~partial.swiftmodule
-rw-r--r-- 1 root root 404 Mar 12 09:22 master.swiftdeps
-rw-r--r-- 1 root root 404 Mar 12 09:22 master.swiftdeps~moduleonly
-rw-r--r-- 1 root root 1542 Mar 12 09:22 output-file-map.json

```

---

<div class="post-metadata">

**Author:** ![sergeyDi](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sergeyDi](https://forums.swift.org/u/sergeyDi)\
**Post date:** [March 18, 2021, 7:32am UTC](https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572/5 "2021-03-18T07:32:06Z")

</div>

Issue happens because of Multipass virtualization solution.

---

<div class="post-metadata">

**Author:** ![mrdekk](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mrdekk/32/31926_2.png) [@mrdekk](https://forums.swift.org/u/mrdekk)\
**Post date:** [September 28, 2023, 6:15pm UTC](https://forums.swift.org/t/ld-gold-error-cannot-open-library/45572/6 "2023-09-28T18:15:03Z")

</div>

Have you solved the problem with Multipass or just stop using it?
