News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Error in compiling in CB

Started by Vivasso, December 16, 2010, 05:17:15 PM

Previous topic - Next topic

Vivasso

Hi I'm newbi in CB. I have to files.
The main.c with some code, and two.c with this code #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <sys/types.h>
#include <sys/uio.h>

int main(int argc, char * argv[]){
  char linha_escrever[1024];
  char * nome_canal;
  char * nome_sensor;
  int num_faixas, vel_maxima;
  FILE * fp;
  long intervalo;
  float velocidade, velocidade_ant;
  int acidente =0;
  int x_inic, y_inic;
  int x_fim, y_fim;


  if(argc != 9){ bla, bla

The error is "Multiple definition of main". I know that I cant have more than one file with main, but if I delete the main from the two.c file it gives me a lot of errors and I cant fix it.
Can someone help me?
Thanks

Jenna

Quote from: Vivasso on December 16, 2010, 05:17:15 PM
Can someone help me?

No, this is far beyond our forums/sites scope, so it violates our forum rules.
Please ask it in an appropriate forum for beginners in prgramming.

Topic locked !!