Question

I am trying to get the sample code of PJSIP to work but during compilation i get the error:

MXC061:~$ g++ -I /usr/local/include -L/usr/local/lib -o hello gst.cpp `pkg-config 
--cflags --libs libpjproject`
error: ‘app_perror’ was not declared in this scope
app_perror(THIS_FILE, "Unable to start UDP transport", status);

i know that i should somehow include the library directory but i don't even know which header app_perror() belongs to.

Any help is appreciated.

Was it helpful?

Solution

Most probably this error comes from a copy/paste problem from another sample file. I mean, app_perror is defined on every sample file to show possible errors in different ways depending on test running, this is, for solving your error, you would need to add its definition, initially, at the beginning, for example, before logging_on_rx_msg:

static void app_perror(const char *sender, const char *title, pj_status_t status)
{
    char errmsg[PJ_ERR_MSG_SIZE];

    pj_strerror(status, errmsg, sizeof(errmsg));
    PJ_LOG(1,(sender, "%s: %s", title, errmsg));
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top