Created
August 1, 2010 12:34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1: Make my application tree | |
================================ | |
[root@example mysip]# pwd | |
/home/sun/Downloads/mysip | |
[root@example mysip]# ls | |
Makefile Makefile~ myapp.c~ myapp.cpp myapp.cpp~ | |
Step 2: Show me your Makefile | |
================================ | |
# Modify this to point to the PJSIP location. | |
# PJBASE=/home/sun/Downloads/pjsip/trunk | |
# include $(PJBASE)/build.mak | |
# 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 $@ $< `pkg-config --cflags --libs libpjproject` | |
clean: | |
rm -f myapp.o myapp | |
Step 3: Show me myapp.cpp | |
================================ | |
#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(int argc, char *argv[]) { | |
pj_status_t status; | |
status = pjsua_create(); | |
return 0; | |
} | |
Step 4: Show me the make | |
================================ | |
[root@example mysip]# make | |
cc -o myapp myapp.cpp `pkg-config --cflags --libs libpjproject` | |
Package libpjproject was not found in the pkg-config search path. | |
Perhaps you should add the directory containing `libpjproject.pc' | |
to the PKG_CONFIG_PATH environment variable | |
No package 'libpjproject' found | |
/tmp/ccOnxoMJ.o: In function `main': | |
myapp.cpp:(.text+0xa): undefined reference to `pjsua_create' | |
/tmp/ccOnxoMJ.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0' | |
collect2: ld returned 1 exit status | |
make: *** [myapp] Error 1 | |
[root@example mysip]# | |
OR | |
[root@example mysip]# make | |
cc -o myapp myapp.cpp 'pkg-config --cflags --libs libpjproject' | |
cc: pkg-config --cflags --libs libpjproject: No such file or directory | |
make: *** [myapp] Error 1 | |
[root@example mysip]# | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment