[torqueusers] pbs_connect compiling error

Garrick Staples garrick at usc.edu
Fri Aug 3 23:44:33 MDT 2007

On Fri, Aug 03, 2007 at 11:26:23PM -0500, Ai Niwaer alleged:
> I have torque 2.1.8 running.
> Compiling this code gives me "undefined reference to "pbs_connect" error
> message.
> How do I compile it? What libs did I miss?

You missed libtorque.  You need to pass -ltorque, and possibly -L and -I args
depending on your install.

> #include "pbs_error.h"
> #include "pbs_ifl.h"
> #include "portability.h"
> #include "mcom.h"
> #include "cmds.h"

You don't need pbs_error.h, and portability.h, mcom.h, and cmds.h aren't part
of the public API; so don't include them either.  In addition, your program
needs stdio.h and stdlib.h.

Then use 'pbs-config' to give you the correct cflags and libs.  Once you have
that, you might use one of the following to build it:

gcc `pbs-config --cflags` `pbs-config --libs` foo.c -o foo

gcc `pbs-config --cflags` -c foo.c
gcc `pbs-config --libs` foo.o -o foo

make CFLAGS=`pbs-config --cflags` LDFLAGS=`pbs-config --libs` foo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torqueusers/attachments/20070803/eab447f0/attachment.bin

More information about the torqueusers mailing list