Following these directions, I have created a firebird.config file in my project home directory containing:
Providers = Engine12
RootDirectory=/path/to/proj/home/dir/firebird
DatabaseAccess = Full
ExternalFileAccess = Full
UdfAccess = Full
Where /path/to/proj/home/dir is filled in with the appropriate value.
In my project home directory, I have created a firebird directory containing libfbclient.so, and a plugins directory containing libEngine13.so. I have done:
export LD_LIBRARY_PATH=/path/to/proj/home/dir/firebird
export FIREBIRD=/path/to/proj/home/dir
I have built my example using CMake and linked to both libfbclient and libEngine13. My example, which merely attempts to create a database, contains the following:
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "example.h"
#include <ibase.h>
#include <iostream>
int pr_error (long *, char *);
int main (int argc, char** argv)
{
isc_db_handle newdb = NULL; /* database handle */
isc_tr_handle trans = NULL; /* transaction handle */
ISC_STATUS_ARRAY status; /* status vector */
long sqlcode; /* SQLCODE */
char create_db[160]; /* 'create database' statement */
char new_dbname[128] = "/path/to/proj/directory/new.fdb";
sprintf(create_db, "CREATE DATABASE '%s'", new_dbname);
if (isc_dsql_execute_immediate(status, &newdb, &trans, 0, create_db, 1,
NULL))
{
sqlcode = isc_sqlcode(status);
if (sqlcode == -902)
{
printf("\nDatabase already exists.\n");
printf("Remove %s before running this program.\n\n", new_dbname);
}
if (pr_error(status, "create database"))
return 1;
}
return 0;
}
int pr_error (long* status, char* operation)
{
printf("[\n");
printf("PROBLEM ON \"%s\".\n", operation);
isc_print_status(status);
printf("SQLCODE:%d\n", isc_sqlcode(status));
printf("]\n");
return 1;
}
I receive the following:
PROBLEM ON "create database".
Unable to complete network request to host "my_ip_address". //where my_ip_address is filled in with the appropriate value
-Failed to establish a connection.
SQLCODE:-902
Any ideas why it is using a network connection? I should add I do not have sudo access on this machine or write permissions for root folders such as /tmp, etc. Also, since I am using cmake, the executable is not found in my project home directory (although, my firebird.config and LD_LIBRARY_PATH and FIREBIRD vars contain absolute paths, so I don't think this is the problem).