Xcode problem: ld: symbol(s) not found for architecture x86_64

Hello!
I tried to create a header, where I want to insert the functions that usually use, but when I try to compile with Xcode 5.1, I get this error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef test_header_prova_degli_HEADER_h
#define test_header_prova_degli_HEADER_h

extern int array[ 3 ];

int funzione_1( int a, int b );

void funzione_2( int c );

#endif

################################################

#include "prova_degli_HEADER.h"

int array[ 3 ] = { 0 , 1 , 2 };

int funzione_1( int a , int b )
{
   return ( a + b );
}

void funzione_2( int c )
{
   std::cout << " result is: " << c << std::endl;
}


#################################################

#include <iostream>
#include "prova_degli_HEADER.h"

int main()
{
	for (int i = 0; i < 3; ++i )
	{
		funzione_2( funzione_1( i , 2*i ) );		
	}
	return 0;
}

#################################################




  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)



I searched on google but there seems to be a similar problem, or better the reasons that can cause this error are different and can not seem to solve the problem.

any suggestions?
Thanks in advance
Last edited on
Topic archived. No new replies allowed.