Link Error LNK2019 which makes no sense!
-
Here's the deal, I have a test class that I am working on and everything seems to be in order, yet I am struck with a link error for every time I use this class (I am using this class from my main() function in main.cpp). -I have added both the header and source file for the class into my VC++.NET 2003 project. -Within my main.cpp, is my main() function. At the top of this file, I have the header file to my class included. -I have my class header file included at the top of the class's implementation/source file. -The strange thing is when I ALSO include the implementation (.cpp) file at the top of the main.cpp file, it compiles and links with no problems, but I shouldn't have to be including both files. What am I doing wrong? Or has my VC++.NET 2003 just gone crazy? :confused: Any points into the right direction would be greatly appreciated. Happy Programming! WWW::CodeProject::BNEACETP
-
Here's the deal, I have a test class that I am working on and everything seems to be in order, yet I am struck with a link error for every time I use this class (I am using this class from my main() function in main.cpp). -I have added both the header and source file for the class into my VC++.NET 2003 project. -Within my main.cpp, is my main() function. At the top of this file, I have the header file to my class included. -I have my class header file included at the top of the class's implementation/source file. -The strange thing is when I ALSO include the implementation (.cpp) file at the top of the main.cpp file, it compiles and links with no problems, but I shouldn't have to be including both files. What am I doing wrong? Or has my VC++.NET 2003 just gone crazy? :confused: Any points into the right direction would be greatly appreciated. Happy Programming! WWW::CodeProject::BNEACETP
It's tough to figure out this problem without details about your header/implementation and what the link error is. Is your class a template? If so, then the implementation must be defined in the header. - Mike
-
It's tough to figure out this problem without details about your header/implementation and what the link error is. Is your class a template? If so, then the implementation must be defined in the header. - Mike