Using Btrieve with C++ on Windows x64
Documented below is one approach to using the Btrieve 2 SDK for the C++ programming language. In this example, we will use Visual Studio 2019 to target a native Windows x64 environment. It is assumed that Zen is already installed and running.
-
Install the Btrieve 2 Windows SDK for Zen.
-
Build and execute the Btrieve C++ sample program.
-
Open the Visual Studio x64 Native Tools Command Prompt.
-
Change directory into the Btrieve 2 SDK directory.
-
Build the Btrieve C++ sample program.
-
cl -Iinclude win64\x86_64\btrieveCpp.lib samples\btest.cpp
-
Execute the Btrieve C++ sample program.
-
.\btest.exe 9
-
You should see the output "record: (9, 81, 3.000000)".
-
You may need to change the permissions of the current directory if you receive the error "Error: BtrieveClient::FileCreate():94:Permission error".
Using Btrieve with C++ on Ubuntu 20 x64
Documented below is one approach to using the Btrieve 2 SDK for the C++ programming language. In this example, we will use GNU GCC to target an Ubuntu 20 x64 environment. It is assumed that Zen is already installed and running.
-
Install the Btrieve 2 Linux SDK for Zen.
-
Build and execute the Btrieve C++ sample program.
-
Open a terminal window as a non-"root" user.
-
Change directory into the Btrieve 2 SDK directory.
-
Build the Btrieve C++ sample program.
-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu:/usr/local/actianzen/lib64
-
g++ -o btest -Iinclude -L/usr/local/actianzen/lib64 samples/btest.cpp -lbtrieveCpp -lm
-
Execute the Btrieve C++ sample program.
-
./btest 9
-
You should see the output "record: (9, 81, 3.000000)".
-
You may need to change the permissions of the current directory if you receive the error "Error: BtrieveClient::FileCreate():94:Permission error".