Picture of Wim 4127
Registered 7 years 1 day
Wim 4127 Monday, 27 April 2020, 02:54 PM
IPbxAdminApi::Create results in undefined reference error
When extending the sample project with following lines below to use the PbxAdminApi, I get a compilation/build error in Visual Studio "undefined reference to `IPbxAdminApi::Create(char const*, char const*)'". Code is according to SDK documentation.Why do I get this error and how to solve it?

 //Set logging flags in the base AppInstance object
 logFlags |= LOG_APP;
 logFlags |= LOG_APP_WEBSOCKET;
 logFlags |= LOG_DATABASE;

 RegisterJsonApi(this);

 pbxAdminApi = IPbxAdminApi::Create("xqting.be", "inno13-pbx");
 RegisterJsonApi(pbxAdminApi);
 Log("App instance constructed");


Picture of Carmen Álvarez Méndez (innovaphone)
Moderator Registered 7 years 199 days
Carmen Álvarez Méndez (innovaphone) Monday, 27 April 2020, 03:15 PM
Re: IPbxAdminApi::Create results in undefined reference error
Have you included the pbx_admin file from the SDK?
#include "common/interface/pbx_admin.h"
Picture of Wim 4127
Registered 7 years 1 day
Wim 4127 Monday, 27 April 2020, 04:23 PM
Re: IPbxAdminApi::Create results in undefined reference error
Sure,

I think the error comes from the fact that the interface is defined in a header file only and the linker cannot find any implementation for that Create function. What would be the library that holds the actual implementation for that function?

Wim
Picture of Wim 4127
Registered 7 years 1 day
Wim 4127 Monday, 27 April 2020, 04:28 PM
Re: IPbxAdminApi::Create results in undefined reference error
Additionally, when going to the pbx_admin.h file in visual studio, it "marks" the IPbxAdminApi::Create function with a warning "function definition not found" and suggests to make an implementation for it.

Can you create the default sample project with the innovaphone SDK in Visual Studio and also add these two lines of code to see whether you can build this?
2013
Moderator Registered 16 years 128 days
Guntram Diehl (innovaphone) Monday, 11 May 2020, 02:46 PM in response to Wim 4127
Re: IPbxAdminApi::Create results in undefined reference error
You are right, the code was missing from the lib. I now shared it into the SDK, so it will be there with the next build
← You can define your color theme preference here