Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2004 13:48:02 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Derrick Ryalls <freebsd@fbsdsolutions.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Accessing MySQL from C
Message-ID:  <20040420184802.GA89639@dan.emsphone.com>
In-Reply-To: <A99A5AC30F74624388EE5F757BA58A20D7A2F0@RED-MSG-50.redmond.corp.microsoft.com>
References:  <A99A5AC30F74624388EE5F757BA58A20D7A2F0@RED-MSG-50.redmond.corp.microsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040420184802.GA89639>