Undefined symbol _FSEventStream* in FileWatcher
tete1030 opened this issue · comments
I imported the HotReloading target in my project and it complains about these symbols' missing for both simulator and real device.
Undefined symbols for architecture x86_64:
"_FSEventStreamScheduleWithRunLoop", referenced from:
HotReloading.FileWatcher.init(root: Swift.String, callback: (__C.NSArray, Swift.String) -> ()) -> HotReloading.FileWatcher in HotReloading.o
"_FSEventStreamCreate", referenced from:
HotReloading.FileWatcher.init(root: Swift.String, callback: (__C.NSArray, Swift.String) -> ()) -> HotReloading.FileWatcher in HotReloading.o
"_FSEventStreamStart", referenced from:
HotReloading.FileWatcher.init(root: Swift.String, callback: (__C.NSArray, Swift.String) -> ()) -> HotReloading.FileWatcher in HotReloading.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My project has some objc code, so I added the following to other linker flags. It worked
-Xlinker -undefined -Xlinker dynamic_lookup
if this is not an issue, please close this.
Hi, Good fix! What version of Xcode was this?
xcode 13.3 (13E113)
And it's working OK. Strange you got the error and were able to fix it. This "standalone" injection is quite new.
-Xlinker -undefined -Xlinker dynamic_lookup
is always a good fallback even if it gives you a warning. Thanks for reporting this, closing now.
I've updated the project README with your fix. Thanks!
Thank you for your help and this great tool