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
1 answer

Unresolved Error

While I am compiling its giving error message : usimage.cpp Generating Code... Linking... Creating library .\Output/gci2.lib and object .\Output/gci2.exp cam_simulator.obj : error LNK2001: unresolved external symbol _ffclos cam_simulator.obj :…
0
votes
0 answers

Dagger2 - ApplicationComponent not generated

I followed vogella article: http://www.vogella.com/tutorials/Dagger/article.html I did everything step by step as they suggested. My build.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { …
user1209216
  • 7,404
  • 12
  • 60
  • 123
0
votes
0 answers

msft c unresolved external tying to use dll function in win32 console app

I have a very simple c++ dll that adds two numbers. The source file looks like: extern "C" { __declspec(dllexport) double __stdcall myadder(double a,double a) { return (a+b); } } with a def file: LIBRARY myadder EXPORTS _myadder@16 The…
RichT
  • 21
  • 1
0
votes
0 answers

Unresolved external symbol error related class with template

I made this code: Item.h: #include using namespace std; template class Item { private: Item * next; Item * prev; T * data; public: Item(T * pData = NULL); ~Item(); }; I also made Item.cpp: #include…
Opal Koren
  • 51
  • 1
  • 7
0
votes
1 answer

C++ Failing to link the most basic application

I was making a program for shader parsing and I wanted to move some pieces of code to different classes, then I got a lot of linker errors, started to debug them and tried to get to as basic situation as I can to eliminate them one by one, I removed…
Werem
  • 21
  • 2
0
votes
1 answer

Phaser 3 - Unresolved Method Graphics

I'm learning Phaser 3 with Webstorm, and I can't figure out how to fix this remaining unresolved method (see the picture). There are a lot of documentation on how to use the library but fewer on how to setup our environment. I've set all my…
user7215718
0
votes
0 answers

LIBCURL error in VS2017 C++ :: error LNK2019: unresolved external symbol _curl_easy_init

I compiled CURL for windows to use in VS2017 as shown in this video Also i have defined CURL_STATICLIB in preprocessor in C/C++ configuration properties. Actual project properties is as But it get below unresolved symbol errors for LIBCURL…
0
votes
0 answers

Hostname couldn't be resolved error on some PCs

So I have a big web browser project and everything seems to be working just fine. I have a feature which allows the user to get news about my website when they click a specific button. The way this is supposed to work is it is going to read text out…
0
votes
1 answer

Errors in scanning variables at runtime

I'm beginner to Java programming. I want to solve an expression of the form (a+20b)+(a+20b+21b)+........+(a+20b+...+2(n-1)b) where you are given "q" queries in the form of a, b and n for each query, print the expression value corresponding to the…
0
votes
1 answer

c++ unresolved external symbol itksys-4.13.lib, SystemInformationImplementation

I am trying to compile a code where I use a class defined in a static library .lib. this class is using itk functions, the includes are in the .cpp. I give to my code, the .lib and the .h of the project defining this class. When I try to compile I…
p.deman
  • 584
  • 2
  • 10
  • 24
0
votes
1 answer

32-bit to 64-bit : LNK2019 error, how to retrieve relevant information

I'm working on a 32-bit C++ application, which I'm converting to a 64-bit application (simply choose another configuration, copy and adapt all relevant settings, and try to get it to build), and now I get stuck on linker error LNK2019 "unresolved…
Dominique
  • 16,450
  • 15
  • 56
  • 112
0
votes
0 answers

LNK2019 unresolved external symbol in unmanaged C++ code

I would like to use external C++ libraries in a .Net standard project. I have read something about p/invoke and unmanaged code so I started from something really simple. I created a simple C++ project, the following are the header file and related…
fragae
  • 285
  • 1
  • 3
  • 9
0
votes
0 answers

Including GLAD into a project, when compiling get "unresolved external symbol gladLoadGLLoader"

I'm working with OpenGL and trying to include GLAD into my project, however I'm unsure where to link the glad.c I'm getting the error Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol…
0
votes
0 answers

Unresolved External Error using C function in Visual Studio 2017

I'm writing a C++ program in Visual Studio 2017 that is trying to make use of this C program: https://www.cs.cmu.edu/~quake/triangle.html I have extern "C" {#include triangle.h} at the beginning of my program but I'm still getting an error: LNK2019…
0
votes
0 answers

Unresolved external symbol to inner class

I'm linking against a library with the following class definition (some extraneous members/functions omitted): class metric_family { public: class builder { public: builder(std::string name, std::string help); } …
Madden
  • 1,024
  • 1
  • 9
  • 27