Page 1 of 1

Why do I have to build a project twice?

Posted: Sun Jul 21, 2013 3:22 am
by peredur
I'm using CodeLite 5.2, gcc 4.6.3 on Ubuntu 12.04LTS for building code examples from Understanding and Using C Pointers. On nearly every build (i.e. after I've changed something in the code) I get at least one warning, which seems to be then interpreted as an error. If I then simply build the project again, the warning/error just goes away and I can run the project with no problem.

This is not a major hassle, but I just wondered why it was happening.

Here is the output from a recent build:

Build window output on first iteration:
/bin/sh -c 'make -j 2 -e -f Makefile'
----------Building project:[ pointers_playpen - Debug ]----------
make[1]: se ingresa al directorio «/home/peter/proyectos-codelite/pointers_playpen»
make[1]: se sale del direct
orio «/home/peter/proyectos-codelite/pointers_playpen»
make[1]: se ingresa al directorio «/home/peter/proyectos-codelite/pointers_playpen»
gcc -c "/home/peter/proyectos-codelite/pointers_playpen/main.c" -g -O0 -Wall -o ./Debug/main.o -I. -I.
/home/peter/proyectos-codelite/pointers_playpen/main.c: En la función ‘evaluateArray’:
/home/peter/proyectos-codelite/pointers_playpen/main.c:23:2: aviso: el subíndice de la matriz es de tipo ‘char’ [-Wchar-subscripts]
gcc -o ./Debug/pointers_playpen @"pointers_playpen.txt" -L.
make[1]: se sale del directorio «/home/peter/proyectos-codelite/pointers_playpen»
1 errors, 0 warnings
Build output on second iteration, with no alterations to the code:
/bin/sh -c 'make -j 2 -e -f Makefile'
----------Building project:[ pointers_playpen - Debug ]----------
make[1]: se ingresa al directorio «/home/peter/proyectos-codelite/pointers_playpen»
make[1]: No se hace nada para «all».
make[1]: se sale del directorio «/home/peter/proyectos-codelite/pointers_playpen»
0 errors, 0 warnings
As I say, it's not a major headache, but it's just a bit puzzling.

Regards


PAE

Re: Why do I have to build a project twice?

Posted: Sun Jul 21, 2013 2:53 pm
by Jarod42
As I understand from the 1rst build:
the build succeeds with one warning (reported as Error).

You have to fix the pattern in Settings-> Build Settings... to reflect your language.
(or use an english gcc output see Re: Setting Language - how to)

The second build does nothing since the first build succeeded.