From owner-freebsd-questions@FreeBSD.ORG Tue Apr 20 11:48:08 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 406DD16A4CE for ; Tue, 20 Apr 2004 11:48:08 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8FC743D64 for ; Tue, 20 Apr 2004 11:48:07 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i3KIm2K4005717; Tue, 20 Apr 2004 13:48:02 -0500 (CDT) (envelope-from dan) Date: Tue, 20 Apr 2004 13:48:02 -0500 From: Dan Nelson To: Derrick Ryalls Message-ID: <20040420184802.GA89639@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: Accessing MySQL from C X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 18:48:08 -0000 In the last episode (Apr 20), Derrick Ryalls said: > I am trying to write a little program that will talk to my existing > mysql db server (4.1.1), but am having compile issues. You need -I/usr/local/include/mysql on your compile line, and -L/usr/local/lib/mysql on your link line. gcc -I/usr/local/include/mysql -c sqltest.c gcc -L/usr/local/lib/mysql -o sqltest sqltest.o -lmysqlclient If you are compiling and linking in one step, you need both. gcc -I/usr/local/include/mysql -L/usr/local/lib/mysql -o sqltest sqltest.c -lmysqlclient -- Dan Nelson dnelson@allantgroup.com