I get a undefined reference in function main with code::blocks

88 views Asked by At

I'm using code::bloks with this simple project:

a.cpp :

int get() {return 0;}

main.cpp :

int get();

int main()
{
    int x = get();
    return 0;
}

at compile I get : undefined reference to 'get()' I can solve problem by adding #include "a.cpp" but this is not normal

I tried to include a header a.h with the forward declaration of function get() but get the same error message

0

There are 0 answers