Gcc 编译PJSIP示例

Gcc 编译PJSIP示例,gcc,makefile,compiler-errors,pjsip,Gcc,Makefile,Compiler Errors,Pjsip,我试图编译以下PJSIP示例,但在make之后出现了这些错误: 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

我试图编译以下PJSIP示例,但在
make
之后出现了这些错误:

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


谢谢您的帮助

找到了错误。。我在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 $@ $< `pkg-config --cflags --libs libpjproject`

clean:
    rm -f simple_pjsua.o simple_pjsua
#如果您的应用程序位于名为myapp.cpp或myapp.c的文件中
#这是构建二进制文件所需的行。
全部:简单的
myapp:simple_pjsua.c
$(CC)-o$@$<`pkg config--cflags--libs libpjproject`
清洁:
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 $@ $< `pkg-config --cflags --libs libpjproject`

clean:
    rm -f simple_pjsua.o simple_pjsua
#如果您的应用程序位于名为myapp.cpp或myapp.c的文件中
#这是构建二进制文件所需的行。
全部:简单的
simple_pjsua:simple_pjsua.c
$(CC)-o$@$<`pkg config--cflags--libs libpjproject`
清洁:
rm-f simple_pjsua.o simple_pjsua

我忘了将myapp:simple\u pjsua.c更改为
simple\u pjsua.c

发现错误。。我在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 $@ $< `pkg-config --cflags --libs libpjproject`

clean:
    rm -f simple_pjsua.o simple_pjsua
#如果您的应用程序位于名为myapp.cpp或myapp.c的文件中
#这是构建二进制文件所需的行。
全部:简单的
myapp:simple_pjsua.c
$(CC)-o$@$<`pkg config--cflags--libs libpjproject`
清洁:
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 $@ $< `pkg-config --cflags --libs libpjproject`

clean:
    rm -f simple_pjsua.o simple_pjsua
#如果您的应用程序位于名为myapp.cpp或myapp.c的文件中
#这是构建二进制文件所需的行。
全部:简单的
simple_pjsua:simple_pjsua.c
$(CC)-o$@$<`pkg config--cflags--libs libpjproject`
清洁:
rm-f simple_pjsua.o simple_pjsua
我忘了将myapp:simple\u pjsua.c更改为
simple\u pjsua:simple\u pjsua.c