Questions tagged [lnk2019]

LNK2019 is a common MSVC linker error indicating that the linker was unable to find a required external symbol in any compilation unit. Check the SO post on common errors and their resolution.

LNK2019 is a common MSVC linker error indicating that the linker was unable to find a required external symbol in any compilation unit. A possible and common cause of the error is a symbol that is declared but never defined.

Before posting, check these posts

558 questions
122
votes
12 answers

How can I solve the error LNK2019: unresolved external symbol - function?

I get this error, but I don't know how to fix it. I'm using Visual Studio 2013. I made the solution name MyProjectTest This is the structure of my test solution: -function.h #ifndef MY_FUNCTION_H #define MY_FUNCTION_H int multiple(int x, int…
phibao37
  • 2,230
  • 4
  • 26
  • 35
38
votes
4 answers

error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup, but this time it's NOT a Windows/Console problem!

So, the infamous error is back. The project is complaining that it can't find the main() method (that's what the error means, right). However I do have a main, and my project is a Console project, as it should be. It worked before, so I know it's…
OddCore
  • 1,534
  • 6
  • 19
  • 32
29
votes
12 answers

LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

I have the following error: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup There are a lot of threads relating to this error, but none of those solutions worked for me. And, none explained why this error is…
forest.peterson
  • 755
  • 2
  • 13
  • 30
27
votes
4 answers

Linking error LNK2019 in MSVC, unresolved symbols with __imp__ prefix, but should be from static lib

I'm running into linking problems in MSVC for a project that I wrote for g++. Here's the problem: I build libssh as a static library as part of my application, adding the target in cmake with add_library(ssh_static STATIC $libssh_SRCS) Libssh is in…
dlonie
  • 575
  • 2
  • 7
  • 12
19
votes
5 answers

LNK2019: unresolved external symbol in VS unit-testing

I get the error as stated in the title. I ensured the following: - The Include directory, include library and additional include directory are set correctly - In the properties, Subsystem is set to CONSOLE Comments to my code: LifeLib is a project…
Steve
  • 361
  • 1
  • 2
  • 6
17
votes
4 answers

Link error after update from VS2008 to VS2010

Today I encountered a linking problem after updating the VS version from 2008 to 2010, the error is something like this: error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)"…
15
votes
4 answers

C++: error LNK: unresolved external symbol, resulting from virtual functions

Overview of classes etc of my interface! Animal.H: class Animal { public: virtual void walk(); } Animals.CPP =EMPTY Cow.H: class Cow : public Animal { public: virtual void walk(); } Here it should outomatically know the function walk is…
13
votes
4 answers

How to Fix Visual Studio 2012 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string?

How to fix a Visual Studio 2012 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string? I've been compiling a solution containing one exe and several static lib projects on which the exe depends fine with…
13
votes
1 answer

Visual Studio 2012 link errors with static libraries

I recently upgrade to 2012 from 2005 (I'm pretty sure) and ran into link errors when building my solution. I ran out of ideas after hours of searching google and putsing around. I've set up dozens of projects, so I'm pretty certain I've done…
11
votes
2 answers

error LNK2019: unresolved external symbol

I've recently started to program in C++ again, and for the purposes of education, I am working on creating a poker game. The weird part is, I keep getting the following error: 1>LearningLanguage01.obj : error LNK2019: unresolved external symbol…
jbenscoter
  • 171
  • 1
  • 2
  • 11
9
votes
2 answers

How to get rid of this error: "MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup"

I'm Helping a friend with her C++, but to be honest we need a big bit of help. Why we always get this error: "MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup" The Code is below: …
8
votes
3 answers

C++ LNK2019 error with constructors and destructors in derived classes

I have two classes, one inherited from the other. When I compile, I get the following errors: Entity.obj : error LNK2019: unresolved external symbol "public: __thiscall Utility::Parsables::Base::Base(void)" (??0Base@Parsables@Utility@@QAE@XZ)…
BLH
  • 83
  • 1
  • 1
  • 3
8
votes
1 answer

LNK2019 (VS 2008) with full implementation of template function using template function pointers

The following minimal code compiles and links fine in GNU C++: #include // Simple function template void foo(T a,void* = 0) { std::cout << a << std::endl; } // A distpatching class template< class T, void…
8
votes
2 answers

Error LNK2019: Unresolved External Symbol in Visual Studio

I've downloaded this C++ code from the SBIG website in order to control (take pictures and save them) the camera (model ST-401ME) which I purchased from them. I have a Matlab program which needs to call this so I'm trying to compile (with Visual…
Mark T
  • 81
  • 1
  • 1
  • 2
8
votes
6 answers

unresolved external symbol error when importing libraries for OpenCV2.3 in Visual Studios 2010 Express C++

first time posting a question here to stackoverflow. Sorry if I butcher the formatting! I am attempting to follow a basic tutorial on openCV, namely this one: http://aishack.in/tutorials/tracking-colored-objects-in-opencv/ I have looked at various…
Kevin Jonaitis
  • 87
  • 1
  • 1
  • 7
1
2 3
37 38