LNK2005
-
I get this error for many different symbols and it says that they are already defined in func.obj func.obj is a self contained file that does define these vars, but isn't used or call be the ones that the error is generated from. So basically I have func.cpp that defines x then I have func1.cpp and it defines x. These are local to their files why would I get this error? Thanks for the help
-
I get this error for many different symbols and it says that they are already defined in func.obj func.obj is a self contained file that does define these vars, but isn't used or call be the ones that the error is generated from. So basically I have func.cpp that defines x then I have func1.cpp and it defines x. These are local to their files why would I get this error? Thanks for the help
Because they're global in scope, the linker detects the duplicate symbol "x". /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com
-
I get this error for many different symbols and it says that they are already defined in func.obj func.obj is a self contained file that does define these vars, but isn't used or call be the ones that the error is generated from. So basically I have func.cpp that defines x then I have func1.cpp and it defines x. These are local to their files why would I get this error? Thanks for the help
-
I get this error for many different symbols and it says that they are already defined in func.obj func.obj is a self contained file that does define these vars, but isn't used or call be the ones that the error is generated from. So basically I have func.cpp that defines x then I have func1.cpp and it defines x. These are local to their files why would I get this error? Thanks for the help
Make them static to force internal linkage. eg: -- func.cpp -- static int x; // internal linkage, global to func.cpp only -- func1.cpp -- static int x; // internal linkage, global to func1.cpp only “Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002