I am trying to compile the following c code with GCC 4.2 using XCode :

#include <omp.h>
#include <stdio.h>

void main(){

int nthreads, tid, NumberOfProcs;

NumberOfProcs = omp_get_num_procs();
printf("\nWorking on %d Processors",NumberOfProcs);


#pragma omp parallel private(tid)
tid = omp_get_thread_num();
printf("\nWoohoo from thread : %d", tid);
if (tid==0){
nthreads = omp_get_num_threads();
printf("\nMaster says : There is %d out there!", nthreads);
// No more threads
In the project settings I have selected GCC 4.2 and the -fopenmp link option is set by default. Anyway, building with XCode I get errors at link with all openmp routines that cannot be found...

With the following standard Makefile process on my MACPro I have absolutely no such error at link...

CC = /usr/bin/gcc-4.2
CFLAGS = -W -Wall -O3 -fopenmp
LDFLAGS = -fopenmp

SRC = $(wildcard *.c)
OBJS = $(SRC:.c=.o)
AOUT = OpenTest

all : $(AOUT)

OpenTest : $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^

%.o : %.c
$(CC) $(CFLAGS) -o $@ -c $<

clean :
@rm *.o
Any idea to make XCode correctly found the appropriate libs?
Is that possible to show XCode Makefile ?