Easysoft ODBC-ODBC Bridge

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

Last Reviewed:
19th July 2005


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. 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:


/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

The CUSTOM_ODBC_LIBS defines the name of the shared object which provides the ODBC driver which in this case 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 the CUSTOM_ODBC_LIBS:


> 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)

Oracle is a registered trademark of Oracle Corporation and/or its affiliates.