April Escamilla wrote:
>
> Sorry, Paul. My login has little to no permissions right now (we just
> created it yeterday) and my coworker placed the 3 .h files referenced in my
> code, and all the libraries from /usr/local/mysql/lib into my directories
> for testing right now.. we'll change it eventually, but for now, we're just
> testing this out. Sorry for the confusion. Just to see if this was a
> permission problem vs a library problem I tried the following
>
> cc -o mysql_connect mysql_connect.c -lc -L/usr/local/mysql/lib -lmysqlclient
> undefined first referenced
> symbol in file
> mysql_real_connect mysql_connect.o
> i386ld fatal: Symbol referencing errors. No output written to mysql_connect
>
> When I replace the -L/usr/local/mysql/lib with the above mentioned
> /u/april/mysql, I get the exact same error as typed above.
> Also, I tried using mysql_connect as opposed to mysql_real_connect, and
> the same errors occured during that cc as above.
> I am stumped on this one...Again, sorry for the confusion Paul.
>
> thanks,
> april
>
If this had been a permission problem, you would have gotten something
like Permission denied from the linker when it tried to read the library
( I have yet to see the system, though, that is misconfigured to the
point of libraries not being world readable).
Here is the unlitmate test, will work on gcc, not sure if it will work
with other compilers, you would have to read man for those. This will
show which libraries you are actually linking against:
gcc -v -Xlinker -verbose -o mysql_connect mysql_connect.c
-L/u/april/mysql -lmysqlclient > /tmp/linker.dump
Or
(cat "Here is the stuff from the linter ; gcc -v -Xlinker -verbose -o
mysql_connect mysql_connect.c -L/u/april/mysql -lmysqlclient) | mail -s
"Linker stuff" mysql@stripped
--
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)