Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-06

Re: Linux RedHat v.8.0, fpc and mysqlclient: /usr/bin/ld: cannot find -lmysqlclient

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco van de Voort
to Unknown author: I am trying to get access to a DataBase in a MySQL server from a Linux RH 8.0 machine (I…
Show quoted text 8 lines
I am trying to get access to a DataBase in a MySQL server from a Linux RH 8.0 machine (I modified the testdb.pp in order to access the DB): (from a MS-Win98SE machine I got my program to work using/copying the libmySQL.dll into windows\system) I have in the linux machine the "mysqlclient9" installed (mysqlclient9-3.23.22-8) In "/etc/ld.so.conf" I have "/usr/lib/mysql" line. In "/usr/lib/mysql/" I have many ".so" files, "libmysqlclient.so" file is there.

Did you run ldconfig?

Show quoted text 9 lines
And when compilling: fpc testdb.pp I get: .. .. /usr/bin/ld: cannot find -lmysqlclient testdb.pp(88,3) Error while linking) Closing script ppas.sh

If the above thing still fails, simply add

-Fl/usr/lib/mysql

to your fpc.cfg as an override to the normal ld configuration.

Unknown author

I am trying to get access to a DataBase in a MySQL server from a Linux RH 8.0 machine (I modified the testdb.pp in order to access the DB): (from a MS-Win98SE machine I got my program to work using/copying the libmySQL.dll into windows\system)
I have in the linux machine the "mysqlclient9" installed (mysqlclient9-3.23.22-8)
In "/etc/ld.so.conf" I have "/usr/lib/mysql" line. In "/usr/lib/mysql/" I have many ".so" files, "libmysqlclient.so" file is there.

And when compilling: fpc testdb.pp

I get:

..
..
/usr/bin/ld: cannot find -lmysqlclient
testdb.pp(88,3) Error while linking)
Closing script ppas.sh

Please, help ? Arturo G. Rivera. ----------------------------------------- Do You GorSA ! ? "WebMail hecho facil y sencillo." http://www.gorsa.net.mx/
Marco van de Voort
to Unknown author: Thanks for youy reply... but partially solved the problem... I used "ldconfig", the…

[top-quote somewhat fixed]

Show quoted text 5 lines
> If the above thing still fails, simply add > > -Fl/usr/lib/mysql > > to your fpc.cfg as an override to the normal ld configuration.

^^^^^^^^^^^^^^^^

Show quoted text 12 lines
Thanks for youy reply... but partially solved the problem... I used "ldconfig", the machine took a little while... then.. I modified the "fp.cfg" (adding a "-Fl/usr/lib/mysql/" line, it wasn't there)... then y tried to compile "testdb.pp" again: 1) From the "FreePascal IDE" It worked fine, It compilled... SOLVED. 2) BUT using "fpc testdb.pp" gets the same error "/usr/bin/ld: cannot find -lmysqlclient": I veryfied thad I have two "fp.cfg" files, one in /root/fp.cfg" and other in "/usr/bin/fp.cfg", but now, both are the same. And still do not compile with "fpc testdb.pp". Any other extra idea ?

That's because I said "fpc.cfg", usually in /etc originally (the commandline compilers file), not "fp.cfg"

The equivalent with the IDE is not hand-editing fp.cfg, but adding the directory to "linker directories" or something like that in options->directories.

Unknown author
to Marco van de Voort: Did you run ldconfig? If the above thing still fails, simply add -Fl/usr/lib/mysql to…

Thanks for youy reply... but partially solved the problem...

I used "ldconfig", the machine took a little while... then.. I modified the "fp.cfg" (adding a "-Fl/usr/lib/mysql/" line, it wasn't there)... then y tried to compile "testdb.pp" again:
1) From the "FreePascal IDE" It worked fine, It compilled... SOLVED.

2) BUT using "fpc testdb.pp" gets the same error "/usr/bin/ld: cannot find -lmysqlclient": I veryfied thad I have two "fp.cfg" files, one in /root/fp.cfg" and other in "/usr/bin/fp.cfg", but now, both are the same. And still do not compile with "fpc testdb.pp".
Any other extra idea ?

Show quoted text 27 lines
> I am trying to get access to a DataBase in a MySQL server from a Linux > RH 8.0 machine (I modified the testdb.pp in order to access the DB): > (from a MS-Win98SE machine I got my program to work using/copying the > libmySQL.dll into windows\system) > I have in the linux machine the "mysqlclient9" installed > (mysqlclient9-3.23.22-8) > In "/etc/ld.so.conf" I have "/usr/lib/mysql" line. In > "/usr/lib/mysql/" I have many ".so" files, "libmysqlclient.so" file is > there. Did you run ldconfig? > And when compilling: fpc testdb.pp > > I get: > > .. > .. > /usr/bin/ld: cannot find -lmysqlclient > testdb.pp(88,3) Error while linking) > Closing script ppas.sh If the above thing still fails, simply add -Fl/usr/lib/mysql to your fpc.cfg as an override to the normal ld configuration.

-----------------------------------------
Do You GorSA ! ?
"WebMail hecho facil y sencillo."
http://www.gorsa.net.mx/

Unknown author
to Marco van de Voort: [top-quote somewhat fixed] ^^^^^^^^^^^^^^^^ That's because I said "fpc.cfg", usually in…

PERFECT!, SOLVED.

THANKS A LOT.

Show quoted text 29 lines
[top-quote somewhat fixed] > > If the above thing still fails, simply add > > > > -Fl/usr/lib/mysql > > > > to your fpc.cfg as an override to the normal ld configuration. ^^^^^^^^^^^^^^^^ > Thanks for youy reply... but partially solved the problem... > > I used "ldconfig", the machine took a little while... then.. I > modified the "fp.cfg" (adding a "-Fl/usr/lib/mysql/" line, it wasn't > there)... then y tried to compile "testdb.pp" again: > 1) From the "FreePascal IDE" It worked fine, It compilled... SOLVED. > > 2) BUT using "fpc testdb.pp" gets the same error "/usr/bin/ld: cannot > find -lmysqlclient": I veryfied thad I have two "fp.cfg" files, one in > /root/fp.cfg" and other in "/usr/bin/fp.cfg", but now, both are the > same. And still do not compile with "fpc testdb.pp". > Any other extra idea ? That's because I said "fpc.cfg", usually in /etc originally (the commandline compilers file), not "fp.cfg" The equivalent with the IDE is not hand-editing fp.cfg, but adding the directory to "linker directories" or something like that in options->directories.

-----------------------------------------
Do You GorSA ! ?
"WebMail hecho facil y sencillo."
http://www.gorsa.net.mx/