//class1.cpp
#include <iostream>
#include <stdlib.h>
using namespace std;
class class1
{
public:
int var;
class1(int i)
{
var = i;
}
};
//class1.h:
#include <iostream>
#include <stdlib.h>
using namespace std;
class class1
{
public:
int var;
class1(int i = 0);
};
//main.cpp
#include <iostream>
#include <stdlib.h>
#include "class1.h"
using namespace std;
int main()
{
class1 a(5);
return 0;
}
error: 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall class1::class1(int)" (??0class1@@QAE@H@Z) referenced in function _main
what the heck is going on? I swear I've made almost the exact same program before and It's worked.
class1
both in the header and in the cpp? – Andy Prowl