From owner-freebsd-questions Wed Aug 5 17:43:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA25138 for freebsd-questions-outgoing; Wed, 5 Aug 1998 17:43:13 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail.itw.net (mail.itw.net [206.138.122.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA25127 for ; Wed, 5 Aug 1998 17:43:08 -0700 (PDT) (envelope-from gmann@itw.com) Received: from itw.com (Surfer1-29.tidalwave.com 208.211.4.29) by mail.itw.net (VMailer) via SMTP id 26E733CA7C; Wed, 05 Aug 1998 20:42:45 -0400 (EDT) Message-ID: <35C8FC5C.3AB72BE8@itw.com> Date: Wed, 05 Aug 1998 20:44:12 -0400 From: Mr Bill Organization: Phrantic Physics X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 2.2.6-RELEASE i386) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: Arg...Undefined symbol...error in C program Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello again folks. This oughtta be easy, but then again...I'm trying to use the MySQL C API to access a database. Seems easy enough. Here's a (non-useful) program snippet: -------snibegin------ #include #include main() { MYSQL MySQL; mysql_connect(&MySQL, "mrbill", "bill", "metekake"); } /* main */ -------sniend--------- The header file (mysql.h) has the declaration: MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd); I try, and get: MrBill:~/db/src$ cc -I/usr/local/include/mysql -L/usr/local/lib/mysql -lmysqlclient tryme.c /var/tmp/ccSBG4211.o: Undefined symbol `_mysql_connect' referenced from text segment The MySQL docs say I need to add a -lm library as the last linked lib, but that does not help. The compiler checks the mysql header, because syntax or type errors halt compilation. The lib seems OK: MrBill:/usr/local/lib/mysql$ strings libmysqlclient.a | grep connect _mysql_real_connect _mysql_connect _mysql_reconnect _mysql_real_connect _remember_connection _mysql_connect _connect This oughtta be easy. Have I lost my mind? Thanks -Glen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message