Mac OS X Sierra: Undefined Symbols for the x86_64 Architecture

I am trying to create a Linphone based C source file on Mac OS X Sierra, but I get the following error.

This is the link for the C source file. Http://www.linphone.org/docs/liblinphone/group__basic__call__tutorials.html

Edited:

I am trying to compile from source using this command

clang -o tt tt.c -I / Users / softdev / Downloads / linphone-sdk-3.11.1-mac / include /

Mistake:

Undefined symbols for x86_64 architecture
  ld: symbol (s) not found for x86_64 architecture
  clang: error: linker command failed with exit code 1 (use -v to invoke the call)

I tried to change the target cpu but didn't work.

My system has Xcode 8. Any help on this would be appreciated.

Edited: Completed Output

Undefined symbols for architecture x86_64:
  "_linphone_call_get_state", referenced from:
      _main in tt-ca2045.o
  "_linphone_call_ref", referenced from:
      _main in tt-ca2045.o
  "_linphone_call_unref", referenced from:
      _main in tt-ca2045.o
  "_linphone_core_destroy", referenced from:
      _main in tt-ca2045.o
  "_linphone_core_invite", referenced from:
      _main in tt-ca2045.o
  "_linphone_core_iterate", referenced from:
      _main in tt-ca2045.o
  "_linphone_core_new", referenced from:
      _main in tt-ca2045.o
  "_linphone_core_terminate_call", referenced from:
      _main in tt-ca2045.o
  "_ms_usleep", referenced from:
      _main in tt-ca2045.o
ld: symbol (s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
+3


source to share


1 answer


I got a sample code to compile with this:

clang -o hello hello.c -Ilinphone-sdk-3/include -Llinphone-sdk-3/lib -llinphone -lmediastreamer_base

      

The Clang parameter -I

indicates where the header files (.h) live

And as far as my addons -L

go , specifies the path for clang to get to where the libs live. In your case, he can live in-L/Users/softdev/Downloads/linphone-sdk-3.11.1-mac/lib



then -L

specifies which dylib you want to include (separate the prefix lib

and suffix dylib

).

Finally, you need to add the missing line to the sample code you pointed to. Add:

#include <unistd.h>

      

after signal.h

+3


source







All Articles