Обсуждение: More SCO funnies
Ok so thanks to Larry I managed to get postgresql compiled and running on SCO. Now I'm trying to compile a small 'C' program. When I link I get cc -L/usr/local/pgsql/lib -lpq -lm -o t_postgresql t_postgresql.o post_util.o undefined first referenced symbol in file PQexec t_postgresql.o PQclear t_postgresql.o PQfinish t_postgresql.o PQresultStatus t_postgresql.o PQcmdTuples t_postgresql.o PQntuples t_postgresql.o PQgetvalue t_postgresql.o PQftype t_postgresql.o PQfmod t_postgresql.o PQnfields t_postgresql.o PQfname t_postgresql.o PQsetdbLogin t_postgresql.o PQstatus t_postgresql.o floor post_util.o i386ld fatal: Symbol referencing errors. No output written to t_postgresql Larry, can you work your magic again?
* Dave Smith <dave@candata.com> [001201 10:18] wrote: > Ok so thanks to Larry I managed to get postgresql compiled and running > on SCO. Now I'm trying to compile a small 'C' program. When I link I get > > cc -L/usr/local/pgsql/lib -lpq -lm -o t_postgresql t_postgresql.o > post_util.o > undefined first referenced > symbol in file > PQexec t_postgresql.o > PQclear t_postgresql.o > PQfinish t_postgresql.o > PQresultStatus t_postgresql.o > PQcmdTuples t_postgresql.o > PQntuples t_postgresql.o > PQgetvalue t_postgresql.o > PQftype t_postgresql.o > PQfmod t_postgresql.o > PQnfields t_postgresql.o > PQfname t_postgresql.o > PQsetdbLogin t_postgresql.o > PQstatus t_postgresql.o > floor post_util.o > i386ld fatal: Symbol referencing errors. No output written to t_postgresql This looks like a problem on your end, post_util.o references 'floor' and even with -lm it's not being found. Can you compile something with post_util.o without t_postgresql.o to see if it's you or us? :) -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk."
* Dave Smith <dave@candata.com> [001201 12:11]: > Ok so thanks to Larry I managed to get postgresql compiled and running > on SCO. Now I'm trying to compile a small 'C' program. When I link I get > > cc -L/usr/local/pgsql/lib -lpq -lm -o t_postgresql t_postgresql.o > post_util.o > undefined first referenced > symbol in file > PQexec t_postgresql.o > PQclear t_postgresql.o > PQfinish t_postgresql.o > PQresultStatus t_postgresql.o > PQcmdTuples t_postgresql.o > PQntuples t_postgresql.o > PQgetvalue t_postgresql.o > PQftype t_postgresql.o > PQfmod t_postgresql.o > PQnfields t_postgresql.o > PQfname t_postgresql.o > PQsetdbLogin t_postgresql.o > PQstatus t_postgresql.o > floor post_util.o > i386ld fatal: Symbol referencing errors. No output written to t_postgresql > put the -lpq -lm AFTER the .o file > Larry, can you work your magic again? -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
* Dave Smith <dave@candata.com> [001201 13:05]: > Larry Rosenman wrote: > > > * Dave Smith <dave@candata.com> [001201 12:11]: > > > >> Ok so thanks to Larry I managed to get postgresql compiled and running > >> on SCO. Now I'm trying to compile a small 'C' program. When I link I get > >> > >> cc -L/usr/local/pgsql/lib -lpq -lm -o t_postgresql t_postgresql.o > >> post_util.o > >> undefined first referenced > >> symbol in file > >> PQexec t_postgresql.o > >> PQclear t_postgresql.o > >> PQfinish t_postgresql.o > >> PQresultStatus t_postgresql.o > >> PQcmdTuples t_postgresql.o > >> PQntuples t_postgresql.o > >> PQgetvalue t_postgresql.o > >> PQftype t_postgresql.o > >> PQfmod t_postgresql.o > >> PQnfields t_postgresql.o > >> PQfname t_postgresql.o > >> PQsetdbLogin t_postgresql.o > >> PQstatus t_postgresql.o > >> floor post_util.o > >> i386ld fatal: Symbol referencing errors. No output written to t_postgresql > >> > > > > put the -lpq -lm AFTER the .o file > > > > > > > >> Larry, can you work your magic again? > > Well I guess sco and linux are a bit different. Also had to add -lsocket > to the end and presto! > Thanks for your speedy reply NP. It's generally a good idea to specify libraries after the object files. Most "REAL" Unix ld's go in order. LER > -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
Larry Rosenman wrote: > * Dave Smith <dave@candata.com> [001201 12:11]: > >> Ok so thanks to Larry I managed to get postgresql compiled and running >> on SCO. Now I'm trying to compile a small 'C' program. When I link I get >> >> cc -L/usr/local/pgsql/lib -lpq -lm -o t_postgresql t_postgresql.o >> post_util.o >> undefined first referenced >> symbol in file >> PQexec t_postgresql.o >> PQclear t_postgresql.o >> PQfinish t_postgresql.o >> PQresultStatus t_postgresql.o >> PQcmdTuples t_postgresql.o >> PQntuples t_postgresql.o >> PQgetvalue t_postgresql.o >> PQftype t_postgresql.o >> PQfmod t_postgresql.o >> PQnfields t_postgresql.o >> PQfname t_postgresql.o >> PQsetdbLogin t_postgresql.o >> PQstatus t_postgresql.o >> floor post_util.o >> i386ld fatal: Symbol referencing errors. No output written to t_postgresql >> > > put the -lpq -lm AFTER the .o file > > > >> Larry, can you work your magic again? Well I guess sco and linux are a bit different. Also had to add -lsocket to the end and presto! Thanks for your speedy reply