Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2004 11:59:07 -0700
From:      "Derrick Ryalls" <freebsd@fbsdsolutions.com>
To:        "'Dan Nelson'" <dnelson@allantgroup.com>
Cc:        freebsd-questions@freebsd.org
Subject:   RE: Accessing MySQL from C
Message-ID:  <A99A5AC30F74624388EE5F757BA58A20D7A2F1@RED-MSG-50.redmond.corp.microsoft.com>
In-Reply-To: <20040420184802.GA89639@dan.emsphone.com>

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



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