简体   繁体   中英

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? Please give me a tip or direction...

1.Dowland fies downloaded files

2.I link the include catalog with the project link include to project

3.I link the lib catalog with the project link lib to project

4.I link files the debug link files to debug

5.I link files the release link files to release

6.This is my error: error code

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). I don't think there is an ARM version available.

I would investigate something like this: http://www.freetds.org/index.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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