Questions tagged [unresolved-external]

For questions about code that compiles but does not link due to unresolved external symbols. It is important that questions include the full linker command as well as the minimal program that references the name in question.

"Unresolved external symbol" is a linker error. It often means that some function has a declaration, but not a definition.

A common cause of this error is compiling code against a library's headers, but failing to link with that library's code: missing the library from the link command, or picking up a different version of the library.

There is a FAQ: What is an undefined reference/unresolved external symbol error and how do I fix it?. If your question lacks the full linker command, and shows no evidence of having read those answers, do not be surprised if you are redirected there.


How to write a good question

  • Create the simplest reproducible program to demonstrate the issue. A simple way to do this in C is to take the address of the symbol and use it:

    #include <pthread.h>
    
    int main()
    {
        int (*a)(pthread_t) = pthread_detach;
        return !a;
    }
    
  • Show the command used to link the program, and its output:

    gcc -std=c11 -fPIC unresolved-external.c -o unresolved-external
    
    /tmp/user/1432/ccI38tid.o: In function `main':
    unresolved-external.c:5: undefined reference to `pthread_detach'
    collect2: error: ld returned 1 exit status
    
537 questions
0
votes
2 answers

Why is my code generating an "Unresolved external symbol" error?

Ive been writing my code and have declared and defined all the necessary variables and included the necessary header files. Still it gives me "unresolved external symbol" on any functions used within the classes constructor. BowlingAlley.obj : error…
Guy Joel McLean
  • 1,019
  • 4
  • 12
  • 34
0
votes
1 answer

Lazy Initialization and Templates - Linker error

I've a general problem with my application. I want to use lazy initialization with an Array class I've made, to improve performances; all works fine when all code is in a single *.h file, but compiler returns a linker error when I split the code in…
0
votes
1 answer

What could be causing this linker error?

I been trying to resolve this unresolved external symbol on a static variable for hours now, and I'm at my wits' end. I'm using Visual Studio 2010. Here's a simplified overview of the situation: Projects in question: -ProjA (outputs a .dll and…
0
votes
1 answer

Implementing DirectX SDK sample(XAudio2Sound3D) gives me an unresolved external error?

When I implement the XAudio2Sound3D sample from the June 2010 SDK.I pretty much copied it all in my own framework and this one variable(sound3DInstance) shows up as an unresolved external: X3DAudioCalculate(sound3DInstance, &listener, &emitter,…
Brail Brailov
  • 71
  • 1
  • 2
  • 5
0
votes
2 answers

libtorrent unresolved external

I'm getting the following error when I compile my program which links to libtorrent.lib. I've tried compiling libtorrent with different settings, I've tried enabling/disabling DHT, deprecated functions, etc. error LNK2019: unresolved external…
Brad
  • 10,015
  • 17
  • 54
  • 77
0
votes
1 answer

Exported Runnable Jar File - I know what's wrong but not how to fix

How to export to runnable java file with eclipse using slick and lwjgl (Light Weight Java Graphics Library)? So, I have done some research into this and believe I have found the root of the problem and what needs fixing, now I need to figure out how…
Kira Namida
  • 279
  • 3
  • 16
0
votes
1 answer

Unresolve external symbol

I got this when compiling my DLL project: Error 1 error LNK2019: unresolved external symbol "public: unsigned char * __thiscall CDetour::GetThisPtr(void)" (?GetThisPtr@CDetour@@QAEPAEXZ) referenced in function "void __stdcall…
Derezzed
  • 1,093
  • 3
  • 11
  • 15
0
votes
0 answers

Link: Unresolved Externals (stemmed from Polymorphism)

I've been spending the past two days on this, and Googling as much as I can to figure this error out. Unfortunately, everything I've found so far hasn't seemed to resolve a solution. I've triple checked my include guards, along with my virtual…
zeboidlund
  • 9,731
  • 31
  • 118
  • 180
0
votes
0 answers

C: Using HARU Free PDF library in Visual Studio C++

Im trying to use Haru libraries in VS 2010 Ultimate C++, but even if I run their sample code I get errors that look like this: error LNK2019: unresolved external symbol _HPDF_Page_TextOut referenced in function _main and many more similar…
speedyTeh
  • 247
  • 1
  • 8
  • 22
0
votes
2 answers

OpenCV: link error, can't resolve external symbol _cvResize and _cvCvtColor

the reason for the link error is clear, some lib is missing within my link procedure. Unfortunately it seems OpenCV 2.4.1 has changed it's internal structure, so the resolutions I find with Google/the Stackoverflow search function only recommend me…
Elmi
  • 5,899
  • 15
  • 72
  • 143
0
votes
2 answers

Matlab R2007b unresolved externals with Engine utility

I'm trying to run the matlabdemo.c provided with most copies of matlab (mine being Matlab R2007b) and despite my best efforts I keep getting "unresolved externals" errors when I try to compile the program via the Visual Studio Command Prompt. I…
0
votes
0 answers

Error at MATLAB: cvlib_mex.obj : error LNK2019: unresolved external symbol (while trying to using cvlib_mex.c in MATLAB)

I am really in a very bad situation with my project. It is working with my 32bit-desktop and with the same versions of MATLAB (R2012a) and Visual Studio 2010 Express but it is not working on 64-bit laptop. Last error is below: while I am trying to…
0
votes
1 answer

Linker errors for template macro: unresolved external symbol

I am trying to build someone else's code in VS2010. It builds fine in VS2005, but I need to upgrade it. They have defined a macro as follows in a header: #include #include #include…
namford
  • 1,171
  • 1
  • 14
  • 13
0
votes
2 answers

Template errors: unresolved externals and inner friend classes

I'm writing a binary search tree using templates. The idea is that I have a pure abstract base class with virtual operator overload functions used for comparing it with other classes which inherit it of the same type. This class, or rather any class…
zeboidlund
  • 9,731
  • 31
  • 118
  • 180
0
votes
1 answer

Yet another uresolved external case

first time asking. Here's the deal: I have a helper class (at least now it's a class) that has several math functions, that I use throughout the project. #ifndef CUSTOM_UTILS_H #define…