简体   繁体   English

代码中链接库 SQLAPI ++ 的问题:Raspberry PI 3b + 上的块

[英]Problem with link library SQLAPI ++ in Code: Blocks on Raspberry PI 3b +

I have a problem, my goal is to connect to a database, for example MSSQL using C++ on Raspberry Pi and I have a problem with linking the SQLAPI++ library in Code::Blocks, can anyone tell me what I'm doing wrong?我有一个问题,我的目标是连接到数据库,例如在 Raspberry Pi 上使用 C++ 的 MSSQL,我在 Code::Blocks 中链接 SQLAPI++ 库时遇到问题,谁能告诉我我做错了什么? Please give me a tip or direction...请给我一个提示或方向...

1.Dowland fies downloaded files 1.Dowland fies下载的文件

2.I link the include catalog with the project link include to project 2.我将包含目录与项目链接包含到项目

3.I link the lib catalog with the project link lib to project 3.我将lib目录与项目链接lib链接到项目

4.I link files the debug link files to debug 4.I链接文件调试链接文件进行调试

5.I link files the release link files to release 5.I链接文件发布链接文件发布

6.This is my error: error code 6.这是我的错误:错误代码

This is my test code:这是我的测试代码:

#include <stdlib.h>
#include <stdio.h>
#include <SQLAPI.h>

int main()
{
     SAConnection con;
     con.setOption("UseAPI") = "DB-Lib";

try
{
   con.Connect("BEDLAM-M\\SQLEXP2008EN@pubs", "", "", SA_SQLServer_Client);
   SACommand cmd(&con, "select user");
   cmd.Execute();
   if( cmd.FetchNext() )
        printf("USER: %s", cmd[1].asString().GetMultiByteChars());
}
catch(SAException& x)
{
    printf("ERROR %d: %s\n",
        x.ErrNativeCode(), x.ErrText().GetMultiByteChars());

}


    return 0;
}

It looks like you downloaded x86 (Intel/AMD) Linux based libraries rather than ARM (Raspberry Pi).看起来您下载了基于 x86(Intel/AMD)Linux 的库,而不是 ARM(Raspberry Pi)。 I don't think there is an ARM version available.我认为没有可用的 ARM 版本。

I would investigate something like this: http://www.freetds.org/index.html我会调查这样的事情: http://www.freetds.org/index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM