Jump to content

Recommended Posts

Posted

Estou aqui a tentar seguir uns exercícios e num isto está-me a dar um erro que eu não sei resolver...

Estou em Linux e a compilar com o gcc...

O code é este:

#include <stdio.h>
#define MAX 10
int main (void) {
 float vector [MAX];
 int i;

  for (i = 0; i < MAX; i++)
    vector [i] = i*(MAX-i);

  for (i = 0; i < MAX; i++)
    printf ("%f\n", vector [i]);
getchar ();
return 0;
}

O erro é este:

/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

Kurt Cobain - Grunge misses you

Nissan GT-R - beast killer

Posted
experimenta fazer isso para programas com mais do que um ficheiro de código fonte (.c)

E' para isso que servem as IDE e makefiles 😄 - mas e' importante um programador que trabalhe em linux(e nao so') saber isso.

Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender.

A beleza de um código está em decompor problemas complexos em pequenos blocos simples.

"learn how to do it manually first, then use the wizzy tool to save time."

"Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.