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
0 answers

Unresolved External Symbol somewhere. Can't find. Assistance Needed

I'm recreating pacMan from visual studio as a project for my data structures class. I have an unresolved external symbol in my code so far but I can't find what's causing it in the code.I wrote four classes; Player, Actor, Maze, and Game. Here they…
0
votes
1 answer

unresolved external symbol (LNK 2001) error with pcap functions

I know how to fix typical LNK2019 errors in MSVS (2013) but I'm having some extra trouble when trying to use winpcap.. I installed winpcap from this site (a couple times, actually), which supposedly installed the necessary .dlls I need, and I also…
galois
  • 825
  • 2
  • 11
  • 31
0
votes
1 answer

ODB: unresolved external symbol error when including *.hxx file with common declarations

I must use the ODB framework in my project. I have 2 files: station.hxx and common.hxx with following content: common.hxx #ifndef COMMON_HXX #define COMMON_HXX #include #pragma db value struct ProcessAggregateName { #pragma db…
Software Craftsman
  • 2,999
  • 2
  • 31
  • 47
0
votes
0 answers

C++ unresolved external symbol, I've already defined functions

I've wrote my code nad when I want to build it it says: unresolved external symbol" for some functions, like the destructor: header file: template class Tree { *not important* public: ~Tree() } cpp file: template
0
votes
1 answer

Using winAPI functions in Qt (wininet)

I'm trying to make some ftp style upload function for that I'm using some windows libraries but i'm getting some troubles at compiling time. uploadfile.h #ifndef UPLOADFILE_H #define UPLOADFILE_H #include #include #include…
Daniel Sanin
  • 21
  • 2
  • 7
0
votes
0 answers

Affdex SDK camera detector LNk2019

I am trying to use the Affdex SDK to determine the emotions of someone through facial recognition. When on their website it says the first thing to do is to create a CameraDetector. They say to do: CameraDetector detector = new…
0
votes
0 answers

LNK2019 unresolved external symbol _GetExtendedTcpTable@24

I am trying to use GetExtendedTcpTable function, but when I want to compile this program: #include #include #include void main() { PVOID x = (PVOID)malloc(10000); PDWORD size = 10000; DWORD result =…
Misaz
  • 3,694
  • 2
  • 26
  • 42
0
votes
0 answers

LNK2001 Unresolved external symbol error for variable defined in a namespace

I'm having an unresolved external symbol error for two variables defined in a namespace. This is the code I have in my header and source file defining and declaring my variables. header file #include "States.h" namespace acro { namespace…
Aaron de Windt
  • 16,794
  • 13
  • 47
  • 62
0
votes
1 answer

What is causing me to get the linker error LNK2019?

I'm trying to write a program to calculate the height of a ball at various points in time, but whenever I try to compile I get error LNK2019. Also, it keeps telling me my doubles get converted to ints but I don't know why. 1>------ Build started:…
0
votes
1 answer

Unresolved NON template method being called by template method which is correctly instantiated

I searched the whole internet and stack overflow before deciding to ask this question, so I beg your pardon if I overlooked something quite simple, but here it goes. Working with Visual Studio 2010, I've got a class like this: class MyClass…
Fabio A.
  • 2,517
  • 26
  • 35
0
votes
2 answers

C++ Error in object construction. Unresolved External Symbol

I have three files, a main.cpp file meant for testing my functions, a header file for the class, and the cpp file where my objects and members are declared. I am trying to construct my object Matrix in the main file and receiving error: Error:…
Nick
  • 191
  • 1
  • 2
  • 9
0
votes
0 answers

c++ unresolved external symbols: cannot find the function where the symbol is referenced

I am writing c++ codes. When compiling (win7 system, compile in cmd with build.bat) I get error like this: handler.lib(Media.obj):error LNK2019: unresolved external symbol _lua_pcallk referenced in function "public:void __thiscall…
gladys0313
  • 2,569
  • 6
  • 27
  • 51
0
votes
0 answers

C++ Error: 1 unresolved externals , unresolved external symbol. How can I fix this?

I'm trying to do a program where I input 3 values which are stored in an object and a fourth value which I generate from 2 of the other values and I store that object into a vector. That problem is that I'm getting an error from the…
user3611818
  • 247
  • 2
  • 3
  • 13
0
votes
0 answers

unresolved externals, class error while creating an instance

im trying to write a car class which has a class called "engine" in it i have a problem creating an instance of an engine (named it "myengine") *the error code says that i have unresolved externals i would appreciate any kind…
Leo
  • 31
  • 1
  • 5
0
votes
1 answer

Unresolved External Symbol error, C++ VS15 d3dx9 Library

for some reason i've gotten a "unresolved external symbol" error and I just can't figure out why.. It complains about "__snprintf", "__sprintf" and "__vsnprintf" even though I am not even using those.. Picture of compiler: As you can see I am…