[freetds] sqsh and freetds: link error
James K. Lowden
jklowden at schemamania.org
Mon May 5 22:15:32 EDT 2003
On Tue, 6 May 2003 09:40:43 +0800 , Anthony Kong <anthony.kong at ufjia.com>
> I think I am now blocked by the link problem. I reproduce part of the
> error message just to make sure that we are talking about the same
> =====/usr/src/sqsh-2.1/src/cmd_bcp.c:334: undefined reference to
> `ct_cmd_alloc'/usr/src/sqsh-2.1/src/cmd_bcp.c:341: undefined reference
> to `ct_command'/usr/src/sqsh-2.1/src/cmd_bcp.c:352: undefined reference
> to `ct_send'/usr/src/sqsh-2.1/src/cmd_bcp.c:368: undefined reference to
> `ct_con_alloc'/usr/src/sqsh-2.1/src/cmd_bcp.c:375: undefined reference
> to `ct_callback'/usr/src/sqsh-2.1/src/cmd_bcp.c:384: undefined reference
> to `ct_callback'/usr/src/sqsh-2.1/src/cmd_bcp.c:393: undefined reference
> to `ct_con_props'
> I have tried to include sybase lib in the -L parameter, but the same
> error message is still emitted. (I happens to have the sybase client
> client installed, and I have add
> /opt/sybase-12.5/OCS-12_5/lib:/opt/sybase-12.5/OCS-12_5/lib3p to the -L
OK, if I understand you, you've compiled sqsh by pointing SYBASE
correctly, and putzing with CFLAGS. You want to link, too? Some people!
> So, actually which lib file the sqsh has a dependency upon?
If you look in your freetds build directory, you'll see that that we only
$ (cd build/src/ctlib/.libs/; ls lib*)
libct.a libct.la libct.lai libct.so libct.so.1
But that's not your difficulty, yet (if you get a message about other
missing libraries, then you're up to re-linking by hand, not as hard as it
sounds). At the moment, the linker isn't finding libct, and so can't
resolve gobs of references.
Have a look in your sqsh/src/Makefile for something like this:
# The following variables are configurable by the user. Typically
# these include things that GNU autoconf has a little trouble
# figuring out for itself.
SYBASE_OCOS = /usr/local/
SYBASE_INCDIR = -I$(SYBASE_OCOS)/include
SYBASE_LIBDIR = -L$(SYBASE_OCOS)/lib
The value of SYBASE_OCOS should be what's in $SYBASE. Is that the case?
If not, you can adjust it and have another go.
You absolutely don't need and don't want to include or link to Sybase's OC
Take care not to put a space between -L and its argument.
More information about the FreeTDS