From owner-freebsd-questions Tue Oct 9 21:44:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by hub.freebsd.org (Postfix) with ESMTP id 1E9B937B403 for ; Tue, 9 Oct 2001 21:44:50 -0700 (PDT) Received: from k7.mavetju.org (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id 30ADE2B709; Wed, 10 Oct 2001 06:44:47 +0200 (CEST) Received: by k7.mavetju.org (Postfix, from userid 1001) id E212686; Wed, 10 Oct 2001 14:44:37 +1000 (EST) Date: Wed, 10 Oct 2001 14:44:37 +1000 From: Edwin Groothuis To: Matthew Blacklow Cc: FreeBSD Questions Subject: Re: GCC liinking problems Message-ID: <20011010144437.B2865@k7.mavetju.org> Mail-Followup-To: Edwin Groothuis , Matthew Blacklow , FreeBSD Questions References: <20011010001755.D617@hal9000.servehttp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from matthew.blacklow@ticca.com on Wed, Oct 10, 2001 at 02:30:05PM +1000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Oct 10, 2001 at 02:30:05PM +1000, Matthew Blacklow wrote: > I am trying to compile a program which includes the mysql.h header file. > Everytime I attempt to compile it I get the following error message: > "/tmp/cc6Sg0gZ.o(.text+0x3c): undefined reference to `mysql_init'" > as well as errors for the other mysql functions I call. > > I am compiling it using the following line: > "gcc code.c -I/usr/home/matthew/MySQL/include/" > and the header files are located in that directory. Yes, but the problem is from the linker, not from the compiler. If you add "-L/usr/local/lib/mysql -lmysqlclient" with it it will go much better. Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: ------------------+ http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message