Reputation: 595
I am trying to debug a code written by someone. When I try to compile the file I get the following error. Error: 'PQconnectdbparams' was not declared in this scope. Below is the code snippet
int BSM::ConnectToDB()
{
int nRetVal = FS_SUCCESS;
if (m_pDBconn == NULL)
m_pDBconn = PQconnectdbParams(m_pConnectionKeywords, (const char**)m_pConnectionValues, 0);
int nAttempt = 0;
do
{
if(PQstatus(m_pDBconn) == CONNECTION_OK) break;
PQreset(m_pDBconn);
} while(++nAttempt < nMaxAttemps);
if(PQstatus(m_pDBconn) != CONNECTION_OK)
{
DisconnectFromDB();
nRetVal = CONNECTION_ERROR;
}
return nRetVal;
}
Beginner in C++ and PostgreSQL. Any help appreciated
Upvotes: 1
Views: 698
Reputation: 595
This issue has been resolved. Basically the function 'PQconnectdbparams' was introduced from version 9.0 onwards. I had version 8.4.4 running. On upgrading, the issue was resolved. Thanks
Upvotes: 1