From: RaymanJ Date: March 19 1999 8:54pm Subject: [MySQL] link error List-Archive: http://lists.mysql.com/mysql/643 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello, I am testing out how to connect to MySQL with a C program. This is the first time for me to do this. Problem: When ever I compile my program it gives me an error message as below. /var/tmp/ccyP17051.o: Undefined symbol `_mysql_connect' referenced from text seg ment I have tried to locate this file but to no avail. Can anyone help me with this. Why is it happening and how to fix it. My code below: #include #include #include"/usr/ports/databases/mysql321/work/mysql-3.21.33b/include/mysql.h" MYSQL mysql; void exiterr(int exitcode) { fprintf( stderr, "%s\n", mysql_error(&mysql) ); exit( exitcode ); } int main() { mysql_connect(&mysql, NULL, NULL, NULL); exiterr(1); if (mysql_select_db(&mysql,"test")) exiterr(2); } Thanks, Ray