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

How to load Graph from graphml file with boost

i dont know how to load a graph from graphml file with boost. I'm able to save a graphml file, but loading is not possible. My Graph has the type typedef boost::labeled_graph
Jacks
  • 67
  • 5
0
votes
1 answer

C++ - Unresolved External Error

I am currently writing a stack class that uses linked lists. I feel like i am done but I keep getting an Unresolved external error. Here it is: Error: Unresolved external 'Stack, std::allocator >…
Johnrad
  • 2,637
  • 18
  • 58
  • 98
0
votes
1 answer

Intel IPP: unresolved external symbol _ippiResizeGetSize_8u@32

I am having an odd issue and think there is a simple answer to that but I guess I just can't see the forest because of all the trees. I am trying to compile a program using Intel IPP (Visual Studio 2015) and get the following error message:…
pAt84
  • 213
  • 3
  • 10
0
votes
0 answers

login.obj:-1: error: LNK2019: unresolved external symbol

login.h: #ifndef LOGIN_H #define LOGIN_H #include #include "usecase.h" #include #include #include namespace Ui { class login; } class login : public QMainWindow { Q_OBJECT public: explicit…
thirteen4054
  • 465
  • 4
  • 17
0
votes
2 answers

GStreamer GValue type list

I'm trying to compile my first GStreamer plugin with Visual Studio 2013 (v120). But when I'm trying to init GValue type list g_value_init (&va, GST_TYPE_LIST); I get error LNK2001: unresolved external symbol _gst_value_list_type I found out that…
Teamol
  • 733
  • 1
  • 14
  • 42
0
votes
0 answers

Why doesn't using std::vector work in NetBeans?

I was writing a sample code on NetBeans and I realized that using std::foo does not work on NetBeans. It gives a "unresolved identifier error". This is the sample code below; #include #include #include //Required…
0
votes
1 answer

C++ & VS2015: Problems with unresolved externals and namespaces (maybe caused by openCV)

Hello fellow community, I am really new to stackoverflow although I often find great and inspiring answers, when I am really stucked. This one I wasn't able to find anything, so I post it. Short introduction: I teached myself c++ in 2010 and then…
Sceen
  • 17
  • 7
0
votes
1 answer

C++ - Unresolved external symbol error

I've been searching around and have come to a stop with this thing. I basically get these errors here: 1>Client.obj : error LNK2019: unresolved external symbol "class std::basic_string,class std::allocator >…
mikkel1156
  • 71
  • 3
  • 10
0
votes
0 answers

How to configure Qt to include a class from another project (not a static library)?

I would like to use a class from one Qt project (A) in another (B). I am able to successfully include the .h file from A in B, and build project B. However, when I try to create an object declared in the .h file in B, I get a link error (Unresolved…
galactikuh
  • 765
  • 8
  • 18
0
votes
2 answers

template class + operators + friends = unresolved externals

I have a class called fraction, and I'm declaring some operators as friends. I declared the friend operators beforehand, as http://www.parashift.com/c++-faq-lite/templates.html#faq-35.16 told me to do, but it only fixed +, -, *, and /. << and >>…
Caleb Jares
  • 6,163
  • 6
  • 56
  • 83
0
votes
0 answers

HDF5 Library, compile problems

I am using the library of the hdf5group to access and parse such H5 Files. Actually I am trying to compile this example: https://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/hdf5-examples/1_8/C/H5G/h5ex_g_traverse.c using Visual Studio 2015 64…
pAt84
  • 213
  • 3
  • 10
0
votes
0 answers

Unresolved external symbol when using template function inside a class

Inside UIHandling.h: enum eType{...}; class UIHandling : public exception { ... UIHandling(eType); template UIHandling(eType, T); ... } Inside another file CompaniesMap I call the second constructor many times using different enums and…
asaf92
  • 1,557
  • 1
  • 19
  • 30
0
votes
3 answers

Unresolved external symbols linking to glew32s.lib

So this isn't the first time I have run into this problem, but the solutions that worked in the past don't seem to be working. I am currently receiving the following errors: Error LNK1120 6 unresolved externals Error LNK2019 unresolved external…
Devurauxe
  • 41
  • 7
0
votes
1 answer

Libtorrent 1.1 unresolved external symbol if_nametoindex

I am trying to make works libtorrent on VS2015 with boost 1.60. I built both and trying to build example "simple_client" from libtorrent but unfortunately it shows me: unresolved external symbol if_nametoindex (broadcast_socket.obj) Any ideas?
0
votes
2 answers

Linker can't find a namespace's functions

See code below. There's something wrong with it, because the linker is complaining it can't find the Memory's functions, but I can't figure out why. memory.h #pragma once #include "includes.h" //it just includes other strandard headers. class…
klenium
  • 2,468
  • 2
  • 24
  • 47