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

LNK2019 error in simple class, cannot see why

I have the following class which will not compile for the unresolved symbol issue LNK2019. I have seen another thread which appears to be a similar issue, but I cannot see why mine is not linking because it is much simpler and seems to be a…
0
votes
1 answer

Getting unresolved external error when operator overloading, even after defining all the methods

EDIT: need to delete post -- problem was trivial (typographical error) and won't be of any help to others I'm getting errorLNK2019, the unresolved external error, when trying to use an operator overload in one of my cpp files. I've looked all over,…
kamoussa
  • 49
  • 1
  • 9
0
votes
1 answer

Getting an unresolved external symbol when compiling c++ class

I have the following classA.h #ifndef ClassAH #define ClassAH class A { public : A(); ~A(); static std::map< std::string, std::vector< string > > getSomething(); } #endif and the implementation in classA.cpp #include…
SomeDude
  • 13,876
  • 5
  • 21
  • 44
0
votes
2 answers

LNK2019 - Unresolved external symbol

I've tried to find a solution to this problem by looking through the old questions and answers, but I can't spot what's wrong in my case. I get the following error: Error 66 error LNK2019: unresolved external symbol "public: static class PhysicsBody…
manabreak
  • 5,415
  • 7
  • 39
  • 96
0
votes
1 answer

Error in compiling: core.obj : error LNK2001: unresolved external symbol _harmony_core_init

Errors core.obj : error LNK2001: unresolved external symbol _harmony_core_init core.obj : error LNK2001: unresolved external symbol _harmony_core_final core.c - piece of code that is function harmony_core_init(); do_init(argc,argv); // Inicializa…
0
votes
1 answer

Jump/Branch Table in C Programming

Kindly Help Me With The following piece of code //jmp_common.h typedef void (*jmp_Handler_t)(void); #define JMP_CMD_HANDLER(com) extern void Jmp_Handler_##com(void) #define JMP_DEF_COM(com) extern void Jmp_Handler_##com(void); #include…
theadnangondal
  • 1,546
  • 3
  • 14
  • 28
0
votes
1 answer

Very peculiar linker error in C++

When I attempt to build my C++ + SDL project in Visual Studio Express 2013, I get the following error: 1>Main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Game::run(void)" (?run@Game@@QAEXXZ) referenced in function…
user1149589
  • 243
  • 3
  • 11
0
votes
2 answers

Unresolved symbol error

I'm working through exercises from Programming Principles and Practice using Visual Studio 2012. When trying to compile the source code below I'm getting a linker error: unresolved symbol int foo. I don't understand why the symbol is unresolved.…
dcrearer
  • 1,972
  • 4
  • 24
  • 48
0
votes
2 answers

LNK2019 glewInit

I have glew version 1.9.0 I have put all the header files in the MSVS include directory and all the lib files in the lib folder. I then put the dll within the sysWOW64 folder and have added all the libs needed in the additional dependencies under…
0
votes
1 answer

error LNK2019: unresolved external symbol

I need your help. I have no idea what is wrong with the code. "Feature" is a template base class with pure virtual function and "AvgSentenceLength" is a child class, but it seems that the problem appears while calling "oneValueMap" function of the…
user3612348
  • 21
  • 1
  • 2
0
votes
0 answers

"Unresolved external symbol" error for strtok in Visual Studio Express 2013, despite including string.h?

So I'm trying to build this simple (incomplete) C program in Visual Studio Express 2013 and I get the linker error "unresolved external symbol _strtok referenced in _split". This confuses me since I was pretty sure my string.h include would include…
0
votes
3 answers

Porting Qt4 to Qt5, getting unresolved external symbols for OpenGL calls

This is in Visual Studio 2010. I can't find any documentation anywhere that says which library contains these functions. I'm already listing these libraries as dependencies: …
0
votes
3 answers

MSVCR100D.dll is missing when build/running project from another PC/VS

I uploaded my (VS2013) project folder and provided it to the other members of my team, but when they tried to build/run it, using Visual Studio 2012 they got this error, it also happened on their version of Visual Studio 2013. The program can't…
0
votes
1 answer

C++ LNK2019 when including header

I have a header file that states the declaration for each function: #ifndef TYPECONVERTER_H_INCLUDED #define TYPECONVERTER_H_INCLUDED #include #include #include #include using namespace std; unsigned int…
0
votes
0 answers

My project is crashed because of my fault

i was working on swipe and tabs in my project then i decide to use sherlock but i changed it to google support api and did it. it worked fine. but when i removing sherlock from the library in project properties and some other places My project is…
Rancbar
  • 184
  • 12