From owner-freebsd-questions@FreeBSD.ORG Tue Apr 20 11:59:52 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 946D716A4D0 for ; Tue, 20 Apr 2004 11:59:52 -0700 (PDT) Received: from clanbuckbuck.org (c-67-160-113-101.client.comcast.net [67.160.113.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 505AD43D62 for ; Tue, 20 Apr 2004 11:59:52 -0700 (PDT) (envelope-from freebsd@fbsdsolutions.com) Received: from RYALLS1 (iustsecurc1202-ge-1-0.msft.net [207.46.238.133]) (AUTH: LOGIN ryallsd, TLS: TLSv1/SSLv3,128bits,RC4-MD5) by clanbuckbuck.org with esmtp; Tue, 20 Apr 2004 11:59:51 -0700 From: "Derrick Ryalls" To: "'Dan Nelson'" Date: Tue, 20 Apr 2004 11:59:07 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 In-Reply-To: <20040420184802.GA89639@dan.emsphone.com> Importance: Normal 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:59:52 -0000 >=20 >=20 > In the last episode (Apr 20), Derrick Ryalls said: > > I am trying to write a little program that will talk to my existing=20 > > mysql db server (4.1.1), but am having compile issues. >=20 > You need -I/usr/local/include/mysql on your compile line, and=20 > -L/usr/local/lib/mysql on your link line.=20 >=20 > gcc -I/usr/local/include/mysql -c sqltest.c > gcc -L/usr/local/lib/mysql -o sqltest sqltest.o -lmysqlclient >=20 > If you are compiling and linking in one step, you need both. >=20 > gcc -I/usr/local/include/mysql -L/usr/local/lib/mysql -o=20 > sqltest sqltest.c -lmysqlclient >=20 > --=20 Thank you very much, missed the -I option in the man completely, and I = don't think I tried -lmysqlclient. I knew it was something simple!