我正在尝试在 ubuntu 下编译简单的 PjSIP 程序。我收到错误
/usr/bin/ld: cannot find -lpjsua-i686-pc-linux-gnu
这是什么意思?
这是输出: -
root@mypc-desktop:/home/mypc/pjsip# make
gcc -o myapp myapp.cpp -DPJ_AUTOCONF=1 -O2 -I/home/mypc/pjproject-1.4.5/pjlib/include -I/home/mypc/pjproject-1.4.5/pjlib-util/include -I/home/mypc/pjproject-1.4.5/pjnath/include -I/home/mypc/pjproject-1.4.5/pjmedia/include -I/home/mypc/pjproject-1.4.5/pjsip/include -L/home/mypc/pjproject-1.4.5/pjlib/lib -L/home/mypc/pjproject-1.4.5/pjlib-util/lib -L/home/mypc/pjproject-1.4.5/pjnath/lib -L/home/mypc/pjproject-1.4.5/pjmedia/lib -L/home/mypc/pjproject-1.4.5/pjsip/lib -L/home/mypc/pjproject-1.4.5/third_party/lib -lpjsua-i686-pc-linux-gnu -lpjsip-ua-i686-pc-linux-gnu -lpjsip-simple-i686-pc-linux-gnu -lpjsip-i686-pc-linux-gnu -lpjmedia-codec-i686-pc-linux-gnu -lpjmedia-i686-pc-linux-gnu -lpjmedia-audiodev-i686-pc-linux-gnu -lpjnath-i686-pc-linux-gnu -lpjlib-util-i686-pc-linux-gnu -lresample-i686-pc-linux-gnu -lmilenage-i686-pc-linux-gnu -lsrtp-i686-pc-linux-gnu -lgsmcodec-i686-pc-linux-gnu -lspeex-i686-pc-linux-gnu -lilbccodec-i686-pc-linux-gnu -lg7221codec-i686-pc-linux-gnu -lportaudio-i686-pc-linux-gnu -lpj-i686-pc-linux-gnu -lm -lnsl -lrt -lpthread
/usr/bin/ld: cannot find -lpjsua-i686-pc-linux-gnu
collect2: ld returned 1 exit status
make: *** [myapp] Error 1
这是代码
#include <pjlib.h>
#include <pjlib-util.h>
#include <pjmedia.h>
#include <pjmedia-codec.h>
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjsip_ua.h>
#include <pjsua-lib/pjsua.h>
int main()
{
return 0;
}
这是一个Makefile
#Modify this to point to the PJSIP location.
PJBASE=/home/mypc/pjproject-1.4.5
include $(PJBASE)/build.mak
CC = $(APP_CC)
LDFLAGS = $(APP_LDFLAGS)
LDLIBS = $(APP_LDLIBS)
CFLAGS = $(APP_CFLAGS)
CPPFLAGS= ${CFLAGS}
# 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: myapp
myapp: myapp.cpp
$(CC) -o $@ $< $(CPPFLAGS) $(LDFLAGS) $(LDLIBS)
clean:
rm -f myapp.o myapp
谢谢
编辑:
我刚刚注意到构建 PjSIP 时出错
make[2]: 进入目录 /home/mypc/pjproject-1.4.5/pjnath/build' make[1]: * [pjnath] 错误 2 make[1]: 离开目录 `/home/mypc/pjproject-1.4. 5/pjnath/build' 制作:* [全部] 错误 1
/home/mypc/pjproject-1.4.5/pjnath/build' gcc -c -Wall -DPJ_AUTOCONF=1 -O2
-Wno-unused-label -Werror -I../include -I../../pjlib/include -I../../pjlib-util/include \ -o output/pjnath-i686-pc-linux-gnu/stun_session.o \ ../src/pjnath/stun_session.c cc1: warnings being treated as errors ../src/pjnath/stun_session.c: In function ‘apply_msg_options’: ../src/pjnath/stun_session.c:230: error: suggest parentheses around && within || make[2]: *** [output/pjnath-i686-pc-linux-gnu/stun_session.o] Error 1 make[2]: Leaving directory
当我试图在 make 文件中找到 -Werror 时/home/mypc/pjproject-1.4.5/pjnath/build
, 它不存在,有人知道它可能在哪里吗$(PJDIR)/build.mak
?$(PJDIR)/build/common.mak