c - libuv undefined reference to uv_loop_new -


after compiling, trying run libuv sample program:

#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; } 

but, when try run, following error:

**/tmp/cchtpspb.o: in function `main': main.c:(.text+0x9): undefined reference `uv_loop_new' main.c:(.text+0x28): undefined reference `uv_run' collect2: error: ld returned 1 exit status** 

where did go wrong ?

ps: doesn't work #include "uv.h"

you need link libuv.a compiled code , linker doesn't know find compiled libuv.

to give better answer need see compile command in meantime recommend video ryan builds sample libuv project. actual code uses little out of date api has changed think find start puts project enlightening.

http://vimeo.com/24713213


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -