// The functions contained in this file are pretty dummy
// and are included only as a placeholder. Nevertheless,
// they *will* get included in the static library if you
// don't remove them :)
//
// Obviously, you 'll have to write yourself the super-duper
// functions to include in the resulting library...
// Also, it's not necessary to write every function in this file.
// Feel free to add more files in this project. They will be
// included in the resulting library.
// A function adding two integers and returning the result
int SampleAddInt(int p, int q)
{
return p + q;
}
// A function doing nothing ;)
void SampleFunction1()
{
// insert code here
}
// A function always returning zero
int SampleFunction2()
{
// insert code here
return 0;
}
2) I create another project with the following code:
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
usingnamespace std;
int SampleAddInt(int, int );
int main()
{
int p=6; int q =5;
SampleAddInt(p,q);
return 0;
}
3) I assure that the compiler and the linker of my project with the .cpp File use the right path and check the dependencies of my library project.
My Problem: But somehow I always get an error saying undefined reference to 'SampleAddInt(int, int )'.
I tried a lot but it just wont work for me. If someone could help me or give me some links I'd appreciate it very much.