2017-04-12 15 views
0

私はthis tutorial次PJSIP例をコンパイルしようとしていますが、私はmake後にこれらのエラーを持っている:コンパイルPJSIP例

もちろん
cc  simple_pjsua.c -o simple_pjsua 
/tmp/ccxmvFQD.o: In function `on_incoming_call': 
simple_pjsua.c:(.text+0x40): undefined reference to `pjsua_call_get_info' 
simple_pjsua.c:(.text+0x45): undefined reference to `pj_log_get_level' 
simple_pjsua.c:(.text+0x6f): undefined reference to `pj_log_3' 
simple_pjsua.c:(.text+0x8b): undefined reference to `pjsua_call_answer' 
/tmp/ccxmvFQD.o: In function `on_call_state': 
simple_pjsua.c:(.text+0xe0): undefined reference to `pjsua_call_get_info' 
simple_pjsua.c:(.text+0xe5): undefined reference to `pj_log_get_level' 
simple_pjsua.c:(.text+0x119): undefined reference to `pj_log_3' 
/tmp/ccxmvFQD.o: In function `on_call_media_state': 
simple_pjsua.c:(.text+0x167): undefined reference to `pjsua_call_get_info' 
simple_pjsua.c:(.text+0x184): undefined reference to `pjsua_conf_connect' 
simple_pjsua.c:(.text+0x196): undefined reference to `pjsua_conf_connect' 
/tmp/ccxmvFQD.o: In function `error_exit': 
simple_pjsua.c:(.text+0x1d0): undefined reference to `pjsua_perror' 
simple_pjsua.c:(.text+0x1d5): undefined reference to `pjsua_destroy' 
/tmp/ccxmvFQD.o: In function `main': 
simple_pjsua.c:(.text+0x20b): undefined reference to `pjsua_create' 
simple_pjsua.c:(.text+0x24b): undefined reference to `pjsua_verify_url' 
simple_pjsua.c:(.text+0x27b): undefined reference to `pjsua_config_default' 
simple_pjsua.c:(.text+0x2ab): undefined reference to `pjsua_logging_config_default' 
simple_pjsua.c:(.text+0x2d3): undefined reference to `pjsua_init' 
simple_pjsua.c:(.text+0x303): undefined reference to `pjsua_transport_config_default' 
simple_pjsua.c:(.text+0x326): undefined reference to `pjsua_transport_create' 
simple_pjsua.c:(.text+0x34c): undefined reference to `pjsua_start' 
simple_pjsua.c:(.text+0x37c): undefined reference to `pjsua_acc_config_default' 
simple_pjsua.c:(.text+0x386): undefined reference to `pj_str' 
simple_pjsua.c:(.text+0x39e): undefined reference to `pj_str' 
simple_pjsua.c:(.text+0x3c0): undefined reference to `pj_str' 
simple_pjsua.c:(.text+0x3d8): undefined reference to `pj_str' 
simple_pjsua.c:(.text+0x3f0): undefined reference to `pj_str' 
/tmp/ccxmvFQD.o:simple_pjsua.c:(.text+0x412): more undefined references to `pj_str' follow 
/tmp/ccxmvFQD.o: In function `main': 
simple_pjsua.c:(.text+0x43b): undefined reference to `pjsua_acc_add' 
simple_pjsua.c:(.text+0x47b): undefined reference to `pj_str' 
simple_pjsua.c:(.text+0x4b3): undefined reference to `pjsua_call_make_call' 
simple_pjsua.c:(.text+0x51c): undefined reference to `pjsua_call_hangup_all' 
simple_pjsua.c:(.text+0x524): undefined reference to `pjsua_destroy' 
collect2: error: ld returned 1 exit status 
<builtin>: recipe for target 'simple_pjsua' failed 
make: *** [simple_pjsua] Error 1 

私は$ ./configure && make dep && make && make installをしました。そして、私は、私はここでそれを見つけることができますlibpjproject libに検索する場合:

/usr$ find -iname "*libpjproject*" 
./local/lib/pkgconfig/libpjproject.pc 


はあなたの助けをありがとう!

答えて

1

エラーが見つかりました。私はMakefileで間違いを犯しました。
動作していない:

# If your application is in a file named myapp.cpp or myapp.c 
# this is the line you will need to build the binary. 
all: simple_pjsua 

myapp : simple_pjsua.c 
    $(CC) -o [email protected] $< `pkg-config --cflags --libs libpjproject` 

clean: 
    rm -f simple_pjsua.o simple_pjsua 

ワーキング:

# If your application is in a file named myapp.cpp or myapp.c 
# this is the line you will need to build the binary. 
all: simple_pjsua 

simple_pjsua: simple_pjsua.c 
    $(CC) -o [email protected] $< `pkg-config --cflags --libs libpjproject` 

clean: 
    rm -f simple_pjsua.o simple_pjsua 

を私はmyapp : simple_pjsua.c

simple_pjsua: simple_pjsua.cにを変更するのを忘れ