Firebird News

Saturday, March 05, 2011

Fixes to fbexport compilation on linux systems debian/ubuntu

It's easy to compile firebird export utility just download the version from sourceforge

cd fbexport-1.90
after that modify fbcopy/TableDependency.cpp
and add
#include <stdio.h>
to the include section otherwise you will get the error error: ‘printf’ was not declared in this scope
make should complete the job (of course you need the firebird headers , check if you have them installed with dpkg -L firebird2.5-dev)

g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbcopy/args.o fbcopy/args.cpp
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbcopy/fbcopy.o fbcopy/fbcopy.cpp
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbcopy/TableDependency.o fbcopy/TableDependency.cpp
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbcopy/main.o fbcopy/main.cpp
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o ibpp/all_in_one.o ibpp/all_in_one.cpp
g++ -pthread -lfbclient ibpp/all_in_one.o fbcopy/args.o fbcopy/fbcopy.o fbcopy/TableDependency.o fbcopy/main.o  -oexe/fbcopy
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbexport/ParseArgs.o fbexport/ParseArgs.cpp
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbexport/FBExport.o fbexport/FBExport.cpp
g++ -c -O1 -DIBPP_LINUX -DIBPP_GCC -Iibpp -o fbexport/cli-main.o fbexport/cli-main.cpp
g++ -pthread -lfbclient ibpp/all_in_one.o fbexport/ParseArgs.o fbexport/FBExport.o fbexport/cli-main.o -oexe/fbexport

and the binary is in exe dir

FBExport v1.80 by Milan Babuskov (mbabuskov), using IBPP
Tool for importing/exporting data with Firebird and InterBase databases.
Usage: fbexport -[S|Sc|Si|Sh|I|If|X|L] Options

 -S  Select = output to file  (S - binary, Si - INSERTs, Sc - CSV, Sh - HTML)
 -I  Insert = input from file
 -If Insert by Full SQL = input from file, by parameterized SQL
 -X  eXecute SQL statement, use with -F to execute sql scripts
 -L  List connected users

Options are:                           -H Host          [LOCALHOST]
 -D Database                           -U Username      [SYSDBA]
 -F Filename (use - for stdout)        -O Role
 -P Password                           -T Trim chars    [off]
 -A "Charset"                          -J "Date format" [D.M.Y]
 -Q "SQL Query statement"              -K "Time format" [H:M:S]
 -C # = Checkpoint at # rows [1000]    -M Commit at each checkpoint [off]
 -E # = Ignore up to # errors [0] Set to -1 to ignore all
 -R Rollback transaction if any errors occur while importing [off]
 -V Table = Verbatim copy of table (use -Q to set where clause if desired)
 -B Separator [,] = Field separator for CSV export. Allows special value: TAB
Command-line options are not case-sensitive (except the TAB setting)

I have added a few more fixes in this fork on the github (related to linking errors) and included the compiling fixes from above 

Post a Comment