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
4
votes
2 answers

Can't build solution in release mode for SDL library on VS 2019

I tried to download the SDL library from this particular link https://www.youtube.com/watch?v=PTQkCRxr6lk&t=194s .However I stumbled upon a "fatal error" and I have no clue what to do in order to solve it. Here's what error I got: 1>------ Build…
Neri-kun
  • 173
  • 3
  • 14
4
votes
2 answers

Linker Error During OpenGL: SuperBible Tutorial

I'm currently trying to decide between DirectX and OpenGL by programming a little DirectX 10 and OpenGL 3.3. I already have the setup for DirectX finished, it was fairly easy to link and compile. OpenGl is... harder. The OpenGL Superbible has a…
IAE
  • 2,213
  • 13
  • 37
  • 71
4
votes
3 answers

Unresolved Externals When Compiling With FreeType

I am compiling a program in Visual Studio 2015, using the FreeType Library. Before, I had used the same project to compile a static library with my own Font class (and many other things), using the library. All was well, and the class worked great.…
4
votes
8 answers

I have lots of questions about c++ that are really confusing me

I started learning c++ about 3 weeks ago after 2 years of java. It seems so different but im getting there. my lecturer is a lovely guy but any time i ask a question as to why something is that way or this way. he just responds "because it…
OVERTONE
  • 11,797
  • 20
  • 71
  • 87
4
votes
1 answer

Osgi will not match native code inside of bundle

I am trying to use a certain Eclipse Plugin that has native code dependencies. These dependencies always go unresolved, so this plugin never gets loaded by OSGI. MANIFEST.MF Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name:…
nimsson
  • 930
  • 1
  • 14
  • 27
4
votes
2 answers

Correct way of linking crypto++ library with my application

I am trying to use Crypto++ library in my Qt application. Qt version is 5.3.0 Compiled with VS2013 running on Windows 8.1 Crypto++ Lib compiled with VS2013 Here is the section of my .pro file which links the lib win32: LIBS +=…
Murtuza Kabul
  • 6,438
  • 6
  • 27
  • 34
4
votes
1 answer

unresolved external symbol, but dumpbin says it's ok

I downloaded Crypto++ 5.62 and built it with default project settings. In my project I set up the path to cryptopp.lib and defined its name in "Additional Dependencies". Both Crypto++ and my project - VS 2008. During building of my project I…
fogbit
  • 1,961
  • 6
  • 27
  • 41
4
votes
2 answers

LLVM JIT-compiled program cannot find external functions

My program which JIT compiles a LLVM IR module and calls a function foo defined therein fails at runtime if foo uses an externally-defined function: LLVM ERROR: Program used external function 'glutInit' which could not be resolved! My program: //…
Jared Hoberock
  • 11,118
  • 3
  • 40
  • 76
4
votes
2 answers

Embedding Tcl in a C program

I am trying to create a simple c++ console app that calls the nagelfar syntax checker on a script. I followed the directions here: http://wiki.tcl.tk/19919 , adding the tclstub85.lib to my input, adding the tcl lib directory to my additional…
4
votes
1 answer

Using Q_OBJECT in VS2010 project gives unresolved externals

I'm trying to use the Q_OBJECT macro in my Visual Studio 2010 Ultimate project, and it gives me unresolved external errors: 1>Application.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall MyButton::qt_metacall(enum…
Kilazi
  • 308
  • 3
  • 14
4
votes
1 answer

error LNK2019 unresolved external symbol

I am quite new to C++ so I downloaded a sample C++ program. The sample program seems to hit the following error when it is compiling :- Error 22 error LNK2019: unresolved external symbol _acsEnumServerNames@12 referenced in function…
3
votes
2 answers

fatal error LNK1120: 16 unresolved externals openssl : ssleay32MD.lib,libeay32MD.lib

I am new to Openssl, and trying to run a dhclient program available online at http://www.josuegomes.com/codeblog/dhclient.htm. While doing so I get following errors, dhclient.cpp 1>dhclient.obj : error LNK2019: unresolved external symbol…
3
votes
3 answers

LNK2019 error, unresolved external symbol

The error verbatim reads 1>yes.obj : error LNK2019: unresolved external symbol "int __cdecl availableMoves(int * const,int (* const)[4],int)" (?availableMoves@@YAHQAHQAY03HH@Z) referenced in function "void __cdecl solveGame(int * const,int (*…
Sam
  • 2,309
  • 9
  • 38
  • 53
3
votes
2 answers

OpenGL/GLEW: Unresolved external _glewInit

I cannot get GLEW to link correctly with my program. I have the path correct in my project (I've triple checked), I have tried building from scratch, using the x86 libs (all 4 - the -s, -mxs, etc) AND the x64 libs. I have tried using the #pragma…
Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145
3
votes
4 answers

LNK2019 unresolved error for inline function

I have no idea why this is happening. The error I get is the following: Error 2 error LNK2019: unresolved external symbol "public: int __thiscall Graphics::GLMatrix::getColumnSize(void)" (?getColumnSize@GLMatrix@Graphics@@QAEHXZ) referenced in…
zeboidlund
  • 9,731
  • 31
  • 118
  • 180