XCode - 导入 Sedna 库

发布于 2024-09-29 00:52:50 字数 890 浏览 4 评论 0原文

我必须在 XCode 中做什么才能包含 Sedna(本机 XML DB)库?

这些文件是:

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

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

我尝试放置这些路径(/usr/local/sedna/driver/c)在“搜索路径”->“用户标题搜索路径”上什么也没有。

代码:

#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;
}

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

川水往事 2024-10-06 00:52:50

只需以与添加源文件相同的方式将它们添加到项目中 - 从 Finder 拖动到项目窗口或使用“添加到项目”菜单选项并导航到库。 (提示:在文件导航对话框中使用 Shift-Command-G 转到特定目录,例如 /usr/local/lib)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文