ld: Can't find library or mismatched ABI for

I started building a program which connects to MySQL and got:

ld: Can't find library or mismatched ABI for -lmysqlclient_r

I tried building my own MySQL and use these, and it worked but then it gave me:

ld: Can't find library or mismatched ABI for -lrt

But librt is a system library (and I'm not gonna recompile these).

Any suggestions?
Might there be something wrong I'm doing when I'm compiling (I'm not really using any flags beside -I and -L -l)?

Thanks,
Sela.

If I use the DD64 flag in compilation, everything works fine.