I think I am having a similar problem to LNK2005, LNK1169 errors, "int __cdecl g(void)" (?g@@YAHXZ) already defined but I cannot find the issue.
I am working with Visual Basic and I am having the following files
main.cpp
#include <iostream>
#include "functions.h"
using namespace std;
int main(){
number();
return 0;
}
I had a functions.cpp
but after reading the question I linked before I renamed it for functions.h
int number(){
int i = 1;
return i;
}
Now it is displaying error LNK2005: "int __cdecl number(void)" (?number@@YAHXZ) already defined in functions.obj
Is there anything wrong with the function number()
in functions.h
?