Questions tagged [lnk2005]

117 questions
-1
votes
1 answer

LNK2005 Error When Implementing static Fields In a Struct

I get LNK2005 "public: static struct Color Color::Black already defined in ***.obj Color.h file contents: #pragma once struct Color { Color(float r, float g, float b) : R{ r }, G{ g }, B{ b }, A{ 1.0f }{} float R; float G; float…
-1
votes
1 answer

C++ LNK2005 already defined in B_calculating.obj

Errors: LNK2005 "private: static char const * const boost::json::key_value_pair::empty_" (?empty_@key_value_pair@json@boost@@0QBDB) already defined in B_calculating.obj LNK2005 "private: static struct boost::json::object::table…
Vernadsky
  • 3
  • 3
-1
votes
1 answer

I keep on having an LNK2005 error while programming in c++ I can't seem to figure out what is the issue

I can't figure out what these two errors are. LNK2005 "public: bool __thiscall Bird::move(void)" (?move@Bird@@QAE_NXZ) already defined in Bird.obj SFML-Game E:\Visual Studio Projects\SFML-Game\SFML-Game\main.obj LNK1169 one or more…
-1
votes
1 answer

Several links errors in my project: LNK2019, LNK2005

I tried every solution for those errors in google, but found no answer for this problem. The project is really big, but here is one of the files: cpp file: #include"Cluster.h" Cluster::Cluster() {} Cluster::~Cluster() //close files and reomve…
-1
votes
1 answer

Error LNK 2005 & LNK1169 C++ Visual Studio DLL

I'm trying to create a DLL plugin for OBS, but when I try to compile a simple script it gives me the following errors - Error 1 error LNK2005: _DllMain@12 already defined in dllmain.obj c:\Users\user\documents\visual studio…
Gerwin
  • 1,572
  • 5
  • 23
  • 51
-1
votes
2 answers

LINKER error: comsupp.lib and comsuppwd.lib

error is: Error 14 error LNK2005: "void __stdcall _set_com_error_handler(void (__stdcall*)(long,struct IErrorInfo *))" (?_set_com_error_handler@@YGXP6GXJPAUIErrorInfo@@@Z@Z) already defined in comsupp.lib(comsupp.obj) comsuppwd.lib Did anyone…
Megidd
  • 7,089
  • 6
  • 65
  • 142
-2
votes
1 answer

"LNK2005 DLLMain already defined ..." conflict in Linker using MSVC

I have a C++ project which up to now had no problems compiling and linking but due to a recent computer crash I had to re-install everything including Visual Studio and all my VCPKG packages. (I am using VS 2022 Preview, and was before.) My project…
David A
  • 123
  • 5
-2
votes
1 answer

LNK2005 and LNK1169 while programing signal in QT

While I've been programing a connection between 2 QThread in QT. First is QMainWindow and second is my own class DB, which base on QThread, becouse I'd like don't to stop GUI thread during downloading data from data base server. But when I've add…
Miziol
  • 42
  • 8
-2
votes
1 answer

LNK2005 function already defined in

I read that "if you declare and implement a function in a header file (Header.h) and if this file gets included twice, then you'll most likely will get a function already defined error at some point.". But in my code all the functions that I get…
Ovidiu Firescu
  • 385
  • 3
  • 11
-2
votes
1 answer

C++ error LNK2005 and general inheritance of different project files

I have three files: A.h #ifndef A_H #define A_H #include #include using namespace std; //FUNCTIONS void main(); int menu(); void inputData(); void processData(); void storeData(); …
-2
votes
1 answer

Error LNK2005 in C++ and ifndef don't work

I have a problem with Visual Studio 2012 & 2015 about the fact than it's seem than the "ifndef" don't work. I use the "ifndef" for "NAN" and "ifndef" for the header file and it's said these 2 errors (see the image). When I add the link…
-5
votes
1 answer

C++ Function already defined in .obj

Fairly new to C++ and not exactly sure what is happening. I've done this for other classes but for this one for some reason i keep getting this error (I also get this error for the start focus function): LNK2005 "public: void __cdecl…
1 2 3 4 5 6 7
8