So I have this really simple situation and I have no idea what is causing this error. This is the relevant bit:
header:
class foo{
void bar(int n);
}
cpp:
#include "foo.h"
foo::bar(int n){
};
And then, from the main function in a separate .cpp file, I do this:
#include "foo.h"
int main(int argc, char *argv[]){
bar(3);
}
I get the error "undefined reference to foo::bar(int* n)"
I have everything linked together right, I've compiled this project plenty of times before. I can find other functions in foo and its constructor from main as well.
If I replace the call to bar with
bar(3.3);
I get the error "no matching function for call to foo::bar(double)" then "note: candidates are void foo::bar(int*)". So the compiler can locate the function just fine at some level.
Any ideas as to what is going on?