Dune Build Error on macOS
When trying to build dune’s executable in the source code base’s bin/main using this command:
dune build bin/main.exe
I get this error:
spawn_stubs.c:296:13: warning: unused function 'subprocess' [-Wunused-function]
static void subprocess(int failure_fd, struct spawn_info *info)
^
1 warning generated.
File "bin/dune", line 4, characters 7-11:
4 | (name main)
^^^^
Undefined symbols for architecture x86_64:
"_CFArrayCreateMutable", referenced from:
paths_of_list in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
"_CFArrayGetValueAtIndex", referenced from:
dune_fsevents_callback in libfsevents_stubs.a(fsevents_stubs.o)
"_CFArraySetValueAtIndex", referenced from:
paths_of_list in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
"_CFDictionaryGetValue", referenced from:
dune_fsevents_callback in libfsevents_stubs.a(fsevents_stubs.o)
"_CFRelease", referenced from:
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
"_CFStringCreateWithCString", referenced from:
paths_of_list in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
"_CFStringGetBytes", referenced from:
dune_fsevents_callback in libfsevents_stubs.a(fsevents_stubs.o)
"_CFStringGetLength", referenced from:
dune_fsevents_callback in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamCreate", referenced from:
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamFlushAsync", referenced from:
dune_fsevents_flush_async in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamFlushSync", referenced from:
dune_fsevents_flush_sync in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamInvalidate", referenced from:
dune_fsevents_stop in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamRelease", referenced from:
dune_fsevents_stop in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamSetDispatchQueue", referenced from:
dune_fsevents_start in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamSetExclusionPaths", referenced from:
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamStart", referenced from:
dune_fsevents_start in libfsevents_stubs.a(fsevents_stubs.o)
"_FSEventStreamStop", referenced from:
dune_fsevents_stop in libfsevents_stubs.a(fsevents_stubs.o)
"___CFConstantStringClassReference", referenced from:
CFString in libfsevents_stubs.a(fsevents_stubs.o)
"_kCFAllocatorDefault", referenced from:
paths_of_list in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
"_kCFTypeArrayCallBacks", referenced from:
paths_of_list in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_create in libfsevents_stubs.a(fsevents_stubs.o)
dune_fsevents_set_exclusion_paths in libfsevents_stubs.a(fsevents_stubs.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
I’m only able to bypass this if I build inside an opam switch by activating one with:
eval $(opam env)
Please does anyone know how I can fix this?
My pc is a macos pro 2017 with intel chip