/* first.c */#include <stdio.h>#include <uv.h>int main() { uv_loop_t *loop = uv_loop_new(); printf("Now quitting.\n"); uv_run(loop,UV_RUN_DEFAulT); return 0;}
我使用libuv文件夹中的以下命令编译它:
gcc -o first first.c build/Release/libuv.a
我得到了以下缺少的符号:
Undefined symbols for architecture x86_64: "_CFArrayCreate",referenced from: _uv__fsevents_init in libuv.a(fsevents.o) "_CFRunLoopAddSource",referenced from: _uv__cf_loop_runner in libuv.a(darwin.o) "_CFRunLoopGetCurrent",referenced from: _uv__cf_loop_runner in libuv.a(darwin.o) "_CFRunLoopRemoveSource",referenced from: _uv__cf_loop_runner in libuv.a(darwin.o) "_CFRunLoopRun",referenced from: _uv__cf_loop_runner in libuv.a(darwin.o) "_CFRunLoopSourceCreate",referenced from: _uv__platform_loop_init in libuv.a(darwin.o) "_CFRunLoopSourceSignal",referenced from: _uv__cf_loop_signal in libuv.a(darwin.o) "_CFRunLoopStop",referenced from: _uv__platform_loop_delete in libuv.a(darwin.o) "_CFRunLoopWakeUp",referenced from: _uv__cf_loop_signal in libuv.a(darwin.o) "_CFStringCreateWithCString",referenced from: _uv__fsevents_init in libuv.a(fsevents.o) "_CFStringGetSystemEnCoding",referenced from: _uv__fsevents_init in libuv.a(fsevents.o) "_FSEventStreamCreate",referenced from: _uv__fsevents_init in libuv.a(fsevents.o) "_FSEventStreamInvalIDate",referenced from: _uv__fsevents_close in libuv.a(fsevents.o) "_FSEventStreamRelease",referenced from: _uv__fsevents_close in libuv.a(fsevents.o) "_FSEventStreamScheduleWithRunLoop",referenced from: _uv__fsevents_schedule in libuv.a(fsevents.o) "_FSEventStreamStart",referenced from: _uv__fsevents_schedule in libuv.a(fsevents.o) "_FSEventStreamStop",referenced from: _uv__fsevents_close in libuv.a(fsevents.o) "_kcfRunLoopDefaultMode",referenced from: _uv__cf_loop_runner in libuv.a(darwin.o) _uv__fsevents_schedule in libuv.a(fsevents.o)ld: symbol(s) not found for architecture x86_64collect2: ld returned 1 exit status
有人可以给我一个关于如何构建libuv的快速教程,或者我还需要什么?
解决方法 通过自制软件安装libuv:$gcc -luv main.c总结
以上是内存溢出为你收集整理的库在os x上编译libuv?全部内容,希望文章能够帮你解决库在os x上编译libuv?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)