The only source modules used to build the callback libraries are ctsqlcbk.c and ctcbklib.c. Under Windows systems we also need ctsqlcbk.def to build the FairCom DB SQL callback library, and ctsqlimp.def to build the import utility callback library.
The callback libraries have no dependencies on FairCom DB or c-treeDB API libraries. Only the header files are referenced.
Below are example makefiles you could use to build the ctsqlcbk.dll for Windows. Unix shared library files are quite similar, and you should consult your local compiler documentation for details.
Note: The compiler and FairCom DB paths will need to be adjusted for your particular development environment. You may wish to investigate your own compiler options and flags based upon your unique needs.
#############################################################
# Your c-treeSQL callback dll makefile
#
# Operating Sys: MS-Windows NT/XP (Intel)
# Compiler: Visual C/C++ (v6.x , v12.xx.xxxx) -VC98: 32bit
# Memory Model: Flat Memory Model
# Protocol: TCP/IP Sockets
#############################################################
# PATH Definition Section
mtBAS =mtmake # m-tree's Base
coBAS =C:\PROGRA~1\MICROS~3\VC98 # Compiler's Base
coBIN =C:\PROGRA~1\MICROS~3\VC98\bin # Compiler's BIN
coBINB=C:\PROGRA~1\MICROS~3\Common\msdev98\bin # Compiler's BINB
coLIB =C:\PROGRA~1\MICROS~3\VC98\lib # Compiler's LIB
coINC =C:\PROGRA~1\MICROS~3\VC98\include # Compiler's INCLUDE
fcBAS =D:\fc8\ctreeSDK\ctreeAPI # FairCom Base
fcSRC =D:\fc8\ctreeSDK\ctreeAPI\ctree\source # FairCom Source
fcINC =D:\fc8\ctreeSDK\ctreeAPI\ctree\include # FairCom Include
fcTOM =D:\fc8\ctreeSDK\ctreeAPI\custom.sql # Custom client Settings
# Compiler/Linker Macro Definition Section
# Object File Switch
CCOF =/Fo
.SUFFIXES:
.SUFFIXES: .c .obj
CP = copy
CPP= $(coBIN)\cl
CC = $(coBIN)\cl
LIBRARIAN = $(coBIN)\lib
RC = $(coBINB)\rc
IMPLIB = $(coBIN)\implib
LINKPP = $(coBIN)\link -subsystem:windows -debug:full -debugtype:cv -pdb:none
LINK = $(coBIN)\link -subsystem:windows -debug:full -debugtype:cv -pdb:none
LINK3 = $(coBIN)\link -subsystem:console -debug:full -debugtype:cv -pdb:none
CFLAGS = -c -DWIN32 -D_X86_=1 -GX $(fcDDD) -Zi -Od
CFLAG2 = -c -DWIN32 -D_X86_=1 -GX $(fcDDD) -Zi -Od
CFLAG3 = -c -DWIN32 -D_X86_=1 -GX $(fcDDD) -Zi -Od
# Make the following components
ALL :: ctsqlcbk.dll
ctsqlcbk.dll: ctsqlcbk.obj ctcbklib.obj
$(LINK) /DLL /MACHINE:IX86 /DEF:ctsqlcbk.def /OUT:ctsqlcbk.dll ctsqlcbk.obj ctcbklib.obj
ctsqlcbk.obj: ctsqlcbk.c
$(CC) -I$(fcINC) -I$(fcSRC) -I$(fcTOM) $(CFLAG2) ctsqlcbk.c
ctcbklib.obj: ctcbklib.c
$(CC) -I$(fcINC) -I$(fcSRC) -I$(fcTOM) $(CFLAG2) ctcbklib.c
#############################################################
# import utility callback dll
#
# Operating Sys: MS-Windows NT (Intel)
# Compiler: Visual C/C++ (v6.x , v12.xx.xxxx) -VC98: 32bit
# Memory Model: Flat Memory Model
# Protocol: TCP/IP Sockets
#############################################################
# PATH Definition Section
mtBAS =mtmake # m-tree's Base
coBAS =C:\PROGRA~1\MICROS~3\VC98 # Compiler's Base
coBIN =C:\PROGRA~1\MICROS~3\VC98\bin # Compiler's BIN
coBINB=C:\PROGRA~1\MICROS~3\Common\msdev98\bin # Compiler's BINB
coLIB =C:\PROGRA~1\MICROS~3\VC98\lib # Compiler's LIB
coINC =C:\PROGRA~1\MICROS~3\VC98\include # Compiler's INCLUDE
fcBAS =D:\fc8\ctreeSDK\ctreeAPI # FairCom Base
fcSRC =D:\fc8\ctreeSDK\ctreeAPI\ctree\source # FairCom Source
fcINC =D:\fc8\ctreeSDK\ctreeAPI\ctree\include # FairCom Include
fcTOM =D:\fc8\ctreeSDK\ctreeAPI\custom.cli # Custom client Settings
# Compiler/Linker Macro Definition Section
# Object File Switch
CCOF =/Fo
.SUFFIXES:
.SUFFIXES: .c .obj
CP = copy
CPP= $(coBIN)\cl
CC = $(coBIN)\cl
LIBRARIAN = $(coBIN)\lib
RC = $(coBINB)\rc
IMPLIB = $(coBIN)\implib
LINKPP = $(coBIN)\link -subsystem:windows -debug:full -debugtype:cv -pdb:none
LINK = $(coBIN)\link -subsystem:windows -debug:full -debugtype:cv -pdb:none
LINK3 = $(coBIN)\link -subsystem:console -debug:full -debugtype:cv -pdb:none
CFLAGS = -c -DWIN32 -D_X86_=1 -GX $(fcDDD) -Zi -Od
CFLAG2 = -c -DWIN32 -D_X86_=1 -GX $(fcDDD) -Zi -Od
CFLAG3 = -c -DWIN32 -D_X86_=1 -GX $(fcDDD) -Zi -Od
# Make the following components
ALL :: ctsqlimp.dll
ctsqlimp.dll: ctsqlcbk.obj ctcbklib.obj
$(LINK) /DLL /MACHINE:IX86 /DEF:ctsqlimp.def /OUT:ctsqlimp.dll ctsqlcbk.obj ctcbklib.obj
ctsqlcbk.obj: ctsqlcbk.c
$(CC) -I$(fcINC) -I$(fcSRC) -I$(fcTOM) $(CFLAG2) ctsqlcbk.c
ctcbklib.obj: ctcbklib.c
$(CC) -I$(fcINC) -I$(fcSRC) -I$(fcTOM) $(CFLAG2) ctcbklib.c