Easysoft
ODBC Drivers for Oracle, SQL Server, Firebird, ISAM, InterBase, Sybase, MS Access & more.

Easysoft ODBC-ODBC Bridge

Undefined reference to xyz when making Apache/PHP

Article : 00082
Last Reviewed : 19th July 2005
Revision : 1

e.g.

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:

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

e.g.

> CUSTOM_ODBC_LIBS="-lesoobclient"
> export CUSTOM_ODBC_LIBS

Applies To

Knowledge Base Feedback

* Did this content help you?
Yes
No
Maybe
 
* Please select one option based on your first choice:
I'm very satisfied
I think it will help, but I haven't tried it yet
It is helpful, but I need more information
It is helpful, but hard to understand
Seemed relevant in search results, but didn't help me
The information is incorrect
The page contains one or more broken links
 
  Suggest new content or let us know how we can improve this content:

 
  (* Required Fields)   



© 1993 - 2008 Easysoft Limited. All rights reserved.