This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to compile a source with "extern"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]