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

387 views Asked by At

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

There are 1 answers

0
Markus Schumann On

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