I have a similar question so I thought I would necro this thread.
I'm a math student trying to write a program so I don't know too much. I'm working on fedora code 5.
I am trying to make a call to a C program called nauty (it calculates automorphism groups of graphs).
As a first step I'm just trying to run one of it's example programs, which executes a simple call to nauty.
However it says "It needs to be linked with nauty.c nautil.c and naugraph.c.".
I've got a vague idea of what that means from reading around here a little bit.
When I try to compile my example program I get a whole host of errors. It seems that the example cannot find nauty. This isn't too suprising since nauty is in a different folder.
So my question is: how do I link my example program to other c files that are located elsewhere?
Here is the example program in full.
The nauty files are in /usr/local/nauty22
Hopefully I havn't broken any protocal here.
/* This program prints generators for the automorphism group of an
n-vertex polygon, where n is a number supplied by the user.
It needs to be linked with nauty.c, nautil.c and naugraph.c.
This version uses a fixed limit for MAXN.
#define MAXN 100
#include "nauty.h" /* which includes <stdio.h> */
options.writeautoms = TRUE;
printf("\nenter n : ");
if (scanf("%d",&n) == 1 && n > 0)
if (n > MAXN)
printf("n must be in the range 1..%d\n",MAXN);
m = (n + WORDSIZE - 1) / WORDSIZE;
for (v = 0; v < n; ++v)
gv = GRAPHROW(g,v,m);
printf("Generators for Aut(C[%d]):\n",n);
Thanks very much for any and all advice.