[Libwebsockets] ld symbols missing in libwebsocket.a

Jeffrey Zhao chunyong.zhao at qq.com
Fri Mar 27 11:30:22 CET 2015


Dear Sir
Could you help on how solve below symbol missing issue?
It seems the libwebsockets doesn't include all the necessary symbols in the library.
Thank you  very much.






content of makefile:
#--------------------------------------------------------------------------------------------
CC = gcc
CFLAGS  = -lpthread -Wall -s -o2
#CFLAGS  = -lpthread -Wall -g -o2
LIBS = "-L/Users/blue/Downloads/libwebsockets/libwebsockets/build/lib/"


all : clean test-server






test-server:test-server.c
  $(CC) $(CFLAGS) $^ -o $@ -lwebsockets $(LIBS)
  gcc test-server.c






clean :
  rm -rf *.o test-server


#--------------------------------------------------------------------------------------------




blue$ make
rm -rf *.o test-server
gcc -lpthread -Wall -s -o2 test-server.c -o test-server -lwebsockets "-L/Users/zhchunyo/Downloads/Mambore_test/libwebsockets/build/lib/"
ld: warning: option -s is obsolete and being ignored
gcc test-server.c
Undefined symbols for architecture x86_64:
  "__lws_log", referenced from:
      _main in test-server-07b887.o
      _callback_http in test-server-07b887.o
      _callback_test in test-server-07b887.o
      _callback_dumb_increment in test-server-07b887.o
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsocket_callback_on_writable", referenced from:
      _callback_http in test-server-07b887.o
      _callback_test in test-server-07b887.o
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsocket_callback_on_writable_all_protocol", referenced from:
      _main in test-server-07b887.o
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsocket_cancel_service", referenced from:
      _sighandler in test-server-07b887.o
  "_libwebsocket_context_destroy", referenced from:
      _main in test-server-07b887.o
  "_libwebsocket_create_context", referenced from:
      _main in test-server-07b887.o
  "_libwebsocket_get_internal_extensions", referenced from:
      _main in test-server-07b887.o
  "_libwebsocket_rx_flow_allow_all_protocol", referenced from:
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsocket_rx_flow_control", referenced from:
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsocket_service", referenced from:
      _main in test-server-07b887.o
  "_libwebsocket_set_timeout", referenced from:
      _callback_http in test-server-07b887.o
  "_libwebsocket_write", referenced from:
      _callback_http in test-server-07b887.o
      _callback_test in test-server-07b887.o
      _callback_dumb_increment in test-server-07b887.o
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsockets_get_protocol", referenced from:
      _callback_lws_mirror in test-server-07b887.o
  "_libwebsockets_return_http_status", referenced from:
      _callback_http in test-server-07b887.o
  "_libwebsockets_serve_http_file", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_add_http_header_by_name", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_add_http_header_by_token", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_add_http_header_content_length", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_add_http_header_status", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_daemonize", referenced from:
      _main in test-server-07b887.o
  "_lws_finalize_http_header", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_get_peer_write_allowance", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_hdr_copy", referenced from:
      _dump_handshake_info in test-server-07b887.o
  "_lws_hdr_total_length", referenced from:
      _callback_http in test-server-07b887.o
      _dump_handshake_info in test-server-07b887.o
  "_lws_http_transateston_completed", referenced from:
      _callback_http in test-server-07b887.o
  "_lws_partial_buffered", referenced from:
      _callback_http in test-server-07b887.o
      _callback_lws_mirror in test-server-07b887.o
  "_lws_send_pipe_choked", referenced from:
      _callback_http in test-server-07b887.o
      _callback_lws_mirror in test-server-07b887.o
  "_lws_set_log_level", referenced from:
      _main in test-server-07b887.o
  "_lws_token_to_string", referenced from:
      _dump_handshake_info in test-server-07b887.o
  "_lwsl_emit_syslog", referenced from:
      _main in test-server-07b887.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [test-server] Error 1
blue$‍
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20150327/3cdf63e0/attachment.html>


More information about the Libwebsockets mailing list