Stream: beginners

Topic: Getting 'System' not found


view this post on Zulip Trevor Settles (Jan 17 2024 at 04:35):

I'm trying roc again after a botched install a year or two ago, so this might be an odd error.

I'm getting ld: library 'System' not found when I build a .roc file or evaluate something in the repl.

RUST_BACKTRACE=full roc main.roc
ld: library 'System' not found
thread 'main' panicked at 'not yet implemented: gracefully handle `ld` (or `zig` in the case of wasm with --optimize) returning exit code Some(1)', crates/compiler/build/src/program.rs:1053:17
stack backtrace:
   0:        0x104b0807b - __mh_execute_header
   1:        0x103ed062b - __mh_execute_header
   2:        0x104b0270e - __mh_execute_header
   3:        0x104b07e2a - __mh_execute_header
   4:        0x104b0c5c5 - __mh_execute_header
   5:        0x104b0c395 - __mh_execute_header
   6:        0x104b0cc61 - __mh_execute_header
   7:        0x104b0c9f4 - __mh_execute_header
   8:        0x104b0b0c9 - __mh_execute_header
   9:        0x104b0c752 - __mh_execute_header
  10:        0x107d98f03 - __ZN4llvm15SmallVectorBaseIyE8grow_podEPvmm
  11:        0x1040c167c - __mh_execute_header
  12:        0x1041a0c39 - __mh_execute_header
  13:        0x10408f06a - __mh_execute_header
  14:        0x104085636 - __mh_execute_header
  15:        0x104085657 - __mh_execute_header
  16:        0x104af9e79 - __mh_execute_header
  17:        0x1040930cc - __mh_execute_header
  18:     0x7ff802f56386 - <unknown>

I tried finding a possible source for the error message in the source, but nothing stood out. I also tried using the --optimize flag, but I still get the same error, so I feel like I'm getting an error before linking actually starts

roc version
roc nightly pre-release, built from commit 79ed84f on Sat Jan 13 09:01:59 UTC 2024
zig version
0.11.0

Any ideas what might cause this? I'm pretty sure its something related to my environment, and I wouldn't be opposed to setting something up in a docker container (or similar) to get a clean start

view this post on Zulip Brendan Hansknecht (Jan 17 2024 at 04:37):

I think System is a default macos library.

view this post on Zulip Brendan Hansknecht (Jan 17 2024 at 04:38):

Quick check, does roc build main.roc --no-link work?

view this post on Zulip Trevor Settles (Jan 17 2024 at 04:41):

Ah, yeah I forgot to mention I am on on macos.
But yes, doing --no-link I do get a main.o file out

view this post on Zulip Brendan Hansknecht (Jan 17 2024 at 04:54):

You may need to run xcode-select --install, but I am not really fully sure.

view this post on Zulip Brendan Hansknecht (Jan 17 2024 at 04:54):

We may also just need to add more library paths for some specific macos versions

view this post on Zulip Trevor Settles (Jan 17 2024 at 04:55):

I just fixed it. I had to install xcode again, and it works now. StackOverflow wasn't helpful, I had ask gpt...
Sorry for posting a non-roc problem...

view this post on Zulip Brendan Hansknecht (Jan 17 2024 at 04:55):

cool


Last updated: Jul 06 2025 at 12:14 UTC