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
1782
votes
39 answers

What is an undefined reference/unresolved external symbol error and how do I fix it?

What are undefined reference/unresolved external symbol errors? What are common causes, and how do I fix and prevent these errors?
222
votes
31 answers

Unresolved external symbol in object files

During coding in Visual Studio I got an unresolved external symbol error and I've got no idea what to do. I don't know what's wrong. Could you please decipher me? Where should I be looking for what kind of errors? 1>Form.obj : error LNK2019:…
Novellizator
  • 13,633
  • 9
  • 43
  • 65
125
votes
20 answers

unresolved external symbol __imp__fprintf and __imp____iob_func, SDL2

Could someone explain what the __imp__fprintf and __imp____iob_func unresolved external means? Because I get these errors when I'm trying to compile: 1>SDL2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol…
RockFrenzy
  • 1,585
  • 3
  • 11
  • 13
62
votes
4 answers

Unresolved external symbol LNK2019

First of all, I know this question is all over this site but I have looked at almost all of them and can't seem to find out what is wrong. This is in VS 2012. Thanks. //Socket.h #pragma once #include #include using…
Iowa15
  • 3,027
  • 6
  • 28
  • 35
43
votes
3 answers

node-express app.get() marked as unresolved in webstorm

If you follow JetBrains' Getting Started with Node.js in WebStorm instructions, node-express specific code is highlighted correctly. However if you create your own simple node-express project, e.g. using node-express' Guide, then express specific…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
40
votes
9 answers

Unresolved symbols when linking a program using libcurl

I know this is programming questions but I'm just frustrated trying to figure out what I'm doing wrong.. I'm using visual studio 2010 and followed all the steps here: http://curl.haxx.se/libcurl/c/visual_studio.pdf When I try to compile my solution…
Kyle
  • 3,004
  • 15
  • 52
  • 79
30
votes
2 answers

Unresolved external symbols - Qt creator

I must be missing a basic concept with headers and includes because when I attempt to call even the simplest of a function from a separate source file I get an error: main.obj:-1: error: LNK2019: unresolved external symbol "void __cdecl …
chuckieDub
  • 1,767
  • 9
  • 27
  • 46
26
votes
2 answers

'LIBCMT' conflicts with use of other libs + unresolved external symbols

I have a program using OpenGL 3.2(+libs) and FreeType2. Then an other program with Boost and OpenSSL. The OpenGL side was to make sure text could be rendered and the boost/openssl program is to do a secure login/game server. Both programs work fine…
23
votes
4 answers

Android Studio unresolved reference. Project compiles

After upgrading Android Studio, a project with no issues started showing issues in the editor. I have lots of Unresolved Reference errors. Anything under the support libraries (support-v4, support-v7). In the screen capture above, anything showing…
Inn0vative1
  • 2,014
  • 3
  • 27
  • 43
19
votes
4 answers

Unresolved externals in C++ when using vectors and find

I have tried this code in a totally separate project, and it works fine (the only difference being that the project that is not working is being exported as a DLL). Here is the code: RTATMATHLIB.CPP #include "stdafx.h" #include…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
19
votes
7 answers

Why does this virtual destructor trigger an unresolved external?

Consider the following: In X.h: class X { X(); virtual ~X(); }; X.cpp: #include "X.h" X::X() {} Try to build this (I'm using a .dll target to avoid an error on the missing main, and I'm using Visual Studio 2010): Error 1 error…
Greg D
  • 43,259
  • 14
  • 84
  • 117
14
votes
3 answers

visual studio building error: unresolved external symbol _IID_IWICImagingFactory (MFC static lib)

I wrote a porgram with a few standard dialogs in an SDI (Doc/View enabled) project. Now that I want to send it to some friends i did set the Use of MFC Use MFC in a static library. But when i try to build the solution i get the following…
Juarrow
  • 2,232
  • 5
  • 42
  • 61
14
votes
1 answer

Boost iostreams with bzip - unresolved symbols

My project was using an older version of Boost's iostreams w/ bzip2. I'm now trying to upgrade to Boost 1.51. At first I did not compile with bzip so obviously I got the linker yelling about libboost_bzip2-vc100-mt-sgd-1_51.lib being missing. I then…
E.K.
  • 321
  • 1
  • 11
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…
12
votes
5 answers

Linking error with `libopencv_highgui.so` under Ubuntu 14.04, strange result with `libtiff.so.5`

Problem I'm compiling the deep learning library Caffe in Ubuntu 14.04(64 bit). OpenCV(Version: 2.4.8+dfsg1-2ubuntu1) is installed from ubuntu packages server with : sudo apt-get install libopencv-dev Compile Caffe with CMake 2.8. Linking…
nn0p
  • 1,189
  • 12
  • 28
1
2 3
35 36