Easysoft ODBC-ODBC Bridge

Why do I get undefined reference to xyz when making Apache/PHP

Last Reviewed:
8th January 2024


modules/php3/libphp3.a(unified_odbc.o): In function `_free_result':
/work/builds/php-3.0.11/functions/unified_odbc.c:192: undefined reference to `SQLFreeStmt'
modules/php3/libphp3.a(unified_odbc.o): In function `_results_cleanup':
/work/builds/php-3.0.11/functions/unified_odbc.c:208: undefined reference to `SQLFreeStmt'

Look at the linker line before the undefined reference messages start and check that there is a -lesoobclient flag. If this is missing, you have probably misconfigured PHP as described below. You can usually check this is what has happened by doing a grep for esoobclient in the top level Makefile. E.g.:

/work/php-3.0.12-> grep esoobclient Makefile

which should show something like:

LIBS = -lgd pcrelib/libpcre.a regex/libregex.a -lgdbm
-L/usr/local/easysoft/oob/client/lib -lesoobclient
-lgd -lm -ldl -lcrypt -lnsl -lresolv

The actual output will depend on the platform, but should contain -lesoobclient.

The CUSTOM_ODBC_LIBS defines the name of the shared object that provides the ODBC driver. In this case, this is the ODBC-ODBC Bridge client shared object (libesoobclient.so, the .so depends on the platform and may be .a or .sl). If the CUSTOM_ODBC_LIBS variable was not set BEFORE making PHP , Apache will not include a reference to the shared object containing the SQL functions and hence the undefined references. See the Apache_PHP text file in the docs directory of the distribution.

If you are not using a shell that allows variables to be assigned at the same time as running a command then set CUSTOM_ODBC_LIBS to -lesoobclient and then export CUSTOM_ODBC_LIBS. E.g.:

> CUSTOM_ODBC_LIBS="-lesoobclient"
Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)