Hi,
I found a problem in pjsua2/config.hpp. This file includes pjsua-lib/pjsua.h without an extern "C" declaration. This makes it impossible to call any of the C-API functions, if I otherwise use the pjsua2 API, because they are connected through this include-chain:
pjsua2.hpp
-> ... (any of those)
-> pjsua2/persistent.hpp
-> pjsua2/types.hpp
-> pjsua2/config.hpp
-> pjsua-lib/pjsua.h
So I guess that's a bug? The fix would be simple:
extern "C" {
#include <pjsua-lib/pjsua.h>
}
BR, Georg
On 18-09-16 13:54, Piewald Georg wrote:
So I guess that’s a bug? The fix would be simple:
extern "C" {
#include <pjsua-lib/pjsua.h>
}
That construct looks odd. Generally I'd expect the .h header to include
the extern part not the caller of the include. See any header in
/usr/include (nowadays perhaps using a __BEGIN_DECLS macro).
And that's what I find inside a sample pjsip/sip_auth.h on my system:
It starts with PJ_BEGIN_DECL, and that in turn is defined as:
/**
#else
#endif
Greetings,
Walter
Ok, makes sense. However, the problem is somewhere else then, since I cannot not link the function pjmedia_type_name(). I would say that in pjmedia/include/pjmedia/types.h the PJ_BEGIN_DECL and PJ_END_DECL are missing?
BR Georg
-----Original Message-----
From: pjsip [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of Walter Doekes
Sent: Monday, September 19, 2016 09:02
To: pjsip list pjsip@lists.pjsip.org
Subject: Re: [pjsip] Linking C-API functions, when using pjsua2
On 18-09-16 13:54, Piewald Georg wrote:
So I guess that's a bug? The fix would be simple:
extern "C" {
#include <pjsua-lib/pjsua.h>
}
That construct looks odd. Generally I'd expect the .h header to include the extern part not the caller of the include. See any header in /usr/include (nowadays perhaps using a __BEGIN_DECLS macro).
And that's what I find inside a sample pjsip/sip_auth.h on my system:
It starts with PJ_BEGIN_DECL, and that in turn is defined as:
/**
#else
Greetings,
Walter
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org