Okay, I tried to build my own, but I got the classic 'undefined reference to ... ' error.
Sources:
The static library:
int add_it_now(int i1, int i2)
{
return i1 + i2;
}
The executable:
#include <iostream>
using namespace std;
int add_it_now(int, int);
int main()
{
cout << add_it_now(5, 2) << endl;
return 0;
}
In the executable's project I added the right search directory for the linker and added the static library to the list. What could I possibly do wrong here?
Thanks in advance
I think you do need a header. Though you did use
int add_it_now(int, int);
so that should suffice