From owner-freebsd-questions@FreeBSD.ORG Tue Apr 20 12:22:43 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 9A48216A4CE for ; Tue, 20 Apr 2004 12:22:43 -0700 (PDT) Received: from internet.potentialtech.com (h-66-167-251-6.phlapafg.covad.net [66.167.251.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6133F43D2D for ; Tue, 20 Apr 2004 12:22:43 -0700 (PDT) (envelope-from wmoran@potentialtech.com) Received: from potentialtech.com (pa-plum1c-102.pit.adelphia.net [24.53.179.102]) by internet.potentialtech.com (Postfix) with ESMTP id 8944669A71; Tue, 20 Apr 2004 15:22:42 -0400 (EDT) Message-ID: <4085787F.5020508@potentialtech.com> Date: Tue, 20 Apr 2004 15:22:39 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031005 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derrick Ryalls References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 19:22:43 -0000 Derrick Ryalls wrote: >> >>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 As a suggestion: consider creating a Makefile and using make to automate the process. make isn't really that hard to use to automate building simple programs, and it's almost necessary to keep the build process for large programs working. If you're not familiar with make, here's a good tutorial to start with: http://www.eng.hawaii.edu/Tutor/Make/ -- Bill Moran Potential Technologies http://www.potentialtech.com