tags:

views:

11

answers:

1

What you I have to do in XCode to include the Sedna (Native XML DB) libs?

The files are:

/usr/local/sedna/driver/c/libsedna.h

/usr/local/sedna/driver/c/libsedna.dylib

I try to puts these path (/usr/local/sedna/driver/c) on "Search Paths"->"User Header Search Paths" and nothing.

Code:

#include <stdio.h>
#include "libsedna.h"

struct SednaConnection conn = SEDNA_CONNECTION_INITIALIZER;  

const char* url = "localhost";
const char* db_name = "databasename";
const char* login = "SYSTEM";
const char* password = "MANAGER";

int main (int argc, const char * argv[]) {
  int res;
  //connecting to database "testdb" with login "SYSTEM", password "MANAGER"
  res = SEconnect(&conn, url, db_name, login, password);
  if(res != SEDNA_SESSION_OPEN) 
  {
    printf("Session starting failed: \n%s\n", SEgetLastErrorMsg(&conn));
    return -1;
  }
  printf("Connection ok!");
  return 0;
}

Thank you

A: 

Just add them to the project in the same way that you add source files - either drag from Finder to project window or use the Add to Project menu option and navigate to the library. (Hint: Use Shift-Command-G in file navigation dialog to go to a specific directory such as /usr/local/lib)

Paul R