I have one header file and two .cpp files.
E.g. normal.h, normal.cpp, abnormal.cpp.
I have included the header files in both the .cpp files.
Now I have an external header, say external.h. I included external.h in normal.h and abnormal.cpp.
But I am getting link errors. Kindly help me on how to include the external header file.
This is my normal.h code
#pragma once
#include<iostream>
#include<external.hpp>
class normal
{
public:
normal();
~normal();
void function();
void Function();
};
normal.cpp code
#include"normal.h"
normal::normal(){
}
normal::~normal(){
}
abnormal.cpp code
#include"normal.h"
#include<external.hpp>
void normal::function()
{
//external library's supported function call
}
Errors Severity Code Description Project File Line Suppression State
Error LNK2005 "public: virtual void __cdecl external::tools::Predicate_ite::reset(void)" (?reset@Predicate_ite@tools@aff3ct@@UEAAXXZ) already defined in abnormal.obj trial3 F:\trial3\trial3\normal.obj 1
Error LNK2005 "public: virtual bool __cdecl external::tools::Predicate_ite::operator()(void)" (??RPredicate_ite@tools@aff3ct@@UEAA_NXZ) already defined in abnormal.obj trial3 F:\trial3\trial3\normal.obj 1
Error LNK2005 "public: __cdecl external::tools::Predicate_ite::Predicate_ite(int)" (??0Predicate_ite@tools@aff3ct@@QEAA@H@Z) already defined in abnormal.obj trial3 F:\trial3\trial3\normal.obj 1
Error LNK1169 one or more multiply defined symbols found trial3 F:\trial3\x64\Release\trial3.dll 1