skip to main content
Setting Up Your Development Environment in C/C++ : Setting Up the IP Source
 

Setting Up the IP Source

You can develop an IP for your SQL-compliant data source by starting with the installed template IP, an installed example, or a sample from the code library at https://www.progress.com.
The steps in this section assume you are starting from the template IP installed at install_dir/ip/oasqlip/template. The template IP consists of stubs for each IP function that you must implement.
If you start from an example, the steps are the same as those when you start from a template IP, except that you replace references to template with example. For code samples downloaded from the code library, follow the instructions provided with the sample.
See Setting Up the oaodbc Sample for details on setting up the OAODBC example that is installed during the OpenAccess SDK installation.
The template IP directory install_dir/ip/oasqlip/template shipped with OpenAccess SDK contains the following files:
xxx_drv.c – defines the IP functions such as OASQLIP_connect
oasqlip.def – export definitions to be used on Windows
oasqlip.vcxproj – Visual Studio project file for Windows
makefile – makefile for use on Linux/UNIX
To set up the source and schema for a new IP:
1. Copy the contents of the ip/oasqlip/template directory and all subdirectories and file to a directory ip/oasqlip/yourip and rename the template files. For example, on UNIX, perform the following commands, replacing yourip with the name you have chosen for your IP:
a. cd install_dir/ip/oasqlip
b. mkdir yourip
c. cp -r template_c/* yourip
d. cd yourip/src
e. mv oasqlip.c yourip_drv.c
2. Edit the project file on Windows or the makefile on UNIX to reference your IP files.
For building on Windows:
a. Open the Visual Studio project ip\oasqlip\yourip\oasqlip.vcxproj.
b. Remove the oasqlip.c files from the Source Files folder and add in yourip.c files and any other files required to build your IP.
c. The Library Files group contains a reference to the oadssqlip.lib and must not be removed. Add references to any other libraries required to build your IP.
d. The project is set up to output the generated DLL to install_dir\ip\bin folder and must not be changed. The name of the file can be changed. This name will be used as the value for ServiceIPModule service attribute when setting up the OpenAccess SDK Service to access your data source.
e. The project is set up to use the oasqlip.def file for exporting the IP API functions. Edit this file to include all of the IP API functions that are being exported. For example, you must have an entry called OASQLIP_connect in this file.
f. Perform a build to make sure your IP DLL builds without any issues and is placed in the install_dir\ip\bin folder.
For building on UNIX:
g. Change to your installation directory.
h. Set up required environment variable:
If working in Korn Shell, then use the command:
unixKshPrompt> . ip/cfg/setenv.sh
If working in C shell, then use the command:
unixCshPrompt> source ip/cfg/setenv.csh
i. Change to directory ip/oasqlip/yourip.
j. Edit the makefile to add source files and required libraries for your IP.
Add any additional files required to build and link your IP. The supplied makefile is set up to create a shared library and to place it in install_dir/ip/bin folder. The name of the output file can be changed. This name will be used as the value for ServiceIPModule attribute when setting up the OpenAccess SDK service to access your data source.
The supplied makefile references install_dir/ip/cfg/env.mk for compiler and linker commands and options. Modify this env.mk file as required for your compiler and system environment.
k. Compile your IP into a shared library by issuing the build command:
unixCshPrompt> make
The development environment and the schema folder for your IP are now set up. Next, set up the OpenAccess SDK service to access your data source. Refer to Debugging an OpenAccess SDK Interface Provider for information on debugging a C/C++ IP.