MS visual studio 2015. "Run code analysis on Solution" works. But "Build solution" FAILS. This is my code. I made a class "account" and defined some methods. I created an object for this class in another cpp file. This works fine, but i am unable to call any function mentod of this class. I dont know why
//AccountBluePrint.h
#include<iostream>
#include<string>
typedef unsigned long int INT;
using namespace std;
class account {
INT accountNumber;
public:
// get functions
char getAccountType();
bool getAccountStatus();
INT getAccountNumber() const {
return accountNumber;
}
//methods
void createNewAccount();
};
//AccountBluePrint.cpp
#include"AccountBluePrint.h"
bool account::getAccountStatus() {
return accountStatus;
}
char account::getAccountType() {
return accountType;
}
void account::createNewAccount() {
char checkAccountType;
}
//BankingAppSource.cpp()`
#include<iostream>
#include<fstream>
#include"AccountBluePrint.h"
void writeNewAccount();
int main() {
char ch;
}
void writeNewAccount() {
account accountObject;
accountObject.createNewAccount();
}
Error is
1>------ Rebuild All started: Project: BankingApplication, Configuration: Debug Win32 ------
1> BankingAppSource.cpp
1> AccountBluePrint.h
1> AccountBluePrint.cpp
1> Generating Code...
1>Debug\AccountBluePrint.obj : warning LNK4042: object specified more than once; extras ignored
1>BankingAppSource.obj : error LNK2019: unresolved external symbol "public: bool __thiscall account::createNewAccount(void)" (?createNewAccount@account@@QAE_NXZ) referenced in function "void __cdecl writeNewAccount(void)" (?writeNewAccount@@YAXXZ)
fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========