This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to compile a source with "extern"
- From: Marcelo Custodio <marcelocustodio at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 8 Mar 2005 11:04:56 -0400
- Subject: How to compile a source with "extern"
- Reply-to: Marcelo Custodio <marcelocustodio at gmail dot com>
Hi,
I've been trying to building files with external resources but I still don't
accomplish it. I am running SuSE Linux 9.2.
I'd like to compile the file teste1.c :
extern int x;
extern void f1();
int main(){
printf("Valor de X no outro arquivo: %d", x);
printf("Chamando a função f1() do outro arqivo...\n");
f1();
}
and the file teste2.c:
void f1(){
printf("Função contida no arquivo teste2.c...\n");
}
// variável global externa
int x = 12;
int main(){
//do nothing...
}
what should I do?
Thanks in advance!
---------------------------------------
Marcelo Monteiro Custódio
System Analyst and Developer
DBA Engenharia de Sistemas