How to compile a source with "extern"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux