Undefined symbols for architecture arm64:

在使用BLWebSocketsServer 框架的过程中,出现的问题
但是这些函数的实现都可以在c 文件中找到,并且在makefile 中已经添加了该文件夹

日志:
Undefined symbols for architecture arm64:
“_libwebsocket_callback_on_writable_all_protocol”, referenced from:
___32-[BLWebSocketsServer pushToAll:]_block_invoke in BLWebSocketsServer.m.68a0b90c.o
“_libwebsocket_context_destroy”, referenced from:
-[BLWebSocketsServer destroyContext:] in BLWebSocketsServer.m.68a0b90c.o
“_libwebsocket_create_context”, referenced from:
-[BLWebSocketsServer createContextWithProtocolName:callbackFunction:andPort:] in BLWebSocketsServer.m.68a0b90c.o
“_libwebsocket_internal_extensions”, referenced from:
-[BLWebSocketsServer createContextWithProtocolName:callbackFunction:andPort:] in BLWebSocketsServer.m.68a0b90c.o
“_libwebsocket_service”, referenced from:
___79-[BLWebSocketsServer startListeningOnPort:withProtocolName:andCompletionBlock:]_block_invoke in BLWebSocketsServer.m.68a0b90c.o
“_libwebsocket_write”, referenced from:
_write_data_websockets in BLWebSocketsServer.m.68a0b90c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

image

osxdesktoplyricsapp_FILES += $(wildcard BLWebSocketsServer/BLWebSocketsServer/*.m) $(wildcard BLWebSocketsServer/BLWebSocketsServer/*/*.c) $(wildcard BLWebSocketsServer/BLWebSocketsServer/*/*.m)
osxdesktoplyricsapp_CFLAGS += -IBLWebSocketsServer/BLWebSocketsServer/libwebsockets -DHAVE_GETIFADDRS=1

虽然不知道你要用这个库干什么,但是提醒一下这个库某些使用场景下有bug的哦

1 个赞

谢谢,我也是后来发现没有编译.c 文件

您还知道有其他ios 的websocket server端的框架吗