Skip to content

Using ADS from mod harbour on Linux

FiveTech Software edited this page Dec 1, 2022 · 3 revisions

In order to use ADS from the mod harbour on Linux, we have to manage these shared libraries using Harbour dynamic linking:

libace.so similar to ace32.dll on Windows

libadsloc.so similar to AdsLoc32.dll on Windows

http://devzone.advantagedatabase.com/dz/WebHelp/Advantage11.1/index.html?ace_distributing_an_advantage_client_engine_enabled_application.htm

to build mod_harbour using ADS please follow these steps:

  1. git clone https://github.com/harbour/core harbour

  2. Install these packages:

sudo apt install libssl-dev
sudo apt install libcurl4-openssl-dev
  1. before building Harbour use this export from the terminal: export HB_USER_CFLAGS=-fPIC

  2. run make in harbour folder and Harbour will get built

  3. To build librddads.a we need ace.h that we can get from here (installing the ADS SDK): https://github.com/FiveTechSoft/harbour_and_xharbour_builds/blob/master/aceapi_x86_64.exe

  4. copy ace.h from above step into harbour/contrib/rddads

  5. Manually compile each C file this way:

gcc -c -fPIC -I../../include ads1.c
gcc -c -fPIC -I../../include adsfunc.c
gcc -c -fPIC -I../../include adsmgmnt.c
gcc -c -fPIC -I../../include adsx.c
  1. to build the librddads.a for Linux do this: ar rc ./librddads.a ads1.o adsx.o adsfunc.o adsmgmnt.o

  2. copy librddads.a to harbour/lib/linux/gcc

  3. In mod_harbour/linux add this lib name to libs.txt: -lrddads

  4. In mod_harbour apache.prg modify this to force the use of ADS:

#define HB_WITH_ADS // new !!!
#ifdef HB_WITH_ADS
#define __HBEXTERN__RDDADS__REQUEST
#include "../../harbour/contrib/rddads/rddads.hbx"
#endif
  1. build mod_harbour running ./go.sh from mod_harbour/linux folder