All Questions

1076
votes
27answers
376253 views

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 to fix/prevent them? Feel free to edit/add your own.
4
votes
1answers
308 views

32-bit absolute addresses no longer allowed in x86-64 Linux?

64 bit Linux uses the small memory model by default, which puts all code and static data below the 2GB address limit. This makes sure that you can use 32-bit absolute addresses. Older versions of gcc ...
78
votes
4answers
97548 views

Undefined reference to `sin`

I have the following code (stripped down to the bare basics for this question): #include<stdio.h> #include<math.h> double f1(double x) { double res = sin(x); return 0; } /* The ...
51
votes
9answers
23570 views

Qt Linker Error: "undefined reference to vtable"

This is my header: #ifndef BARELYSOCKET_H #define BARELYSOCKET_H #include <QObject> //! The First Draw of the BarelySocket! class BarelySocket: public QObject { Q_OBJECT public: Bar...
35
votes
5answers
28069 views

Undefined symbols "vtable for ..." and "typeinfo for..."?

Nearly the final step but still some strange erros.... bash-3.2$ make g++ -Wall -c -g Myworld.cc g++ -Wall -g solvePlanningProblem.o Position.o AStarNode.o PRM.o PRMNode.o World.o SingleCircleWorld.o...
43
votes
4answers
72756 views

undefined reference to sqrt (or other mathematical functions)

I have this simple code: max = (int) sqrt (number); and in the header I have: #include <math.h> But application still says undefined reference to sqrt. Do you see any problem here? It look...
49
votes
5answers
44049 views

Q_OBJECT throwing 'undefined reference to vtable' error

I'm using Qt Creator 2.0.1 with Qt 4.7.0 (32 bit) on Windows 7 Ultimate 32 bit. Consider the following code, which is a minimum to produce the error: class T : public QObject, public QGraphicsItem {...
4
votes
3answers
2204 views

Call C standard library function from asm in Visual Studio

I have a problem with calling C function from asm project created in visual studio (Win10 x64, Visual Studio 2015). Project consist of one asm file: .586 .model flat, stdcall option casemap:none incl...
10
votes
1answers
16878 views

Multiple definition of inline functions when linking static libs

I have a C++ program that I compile with mingw (gcc for Windows). Using the TDM release of mingw which includes gcc 4.4.1. The executable links to two static library (.a) files: On of them is a thi...
7
votes
2answers
9984 views

Cuda C - Linker error - undefined reference

I am having a hard time compiling a simple cuda program consiting of only two files. The main.c looks like this: #include "my_cuda.h" int main(int argc, char** argv){ dummy_gpu(); } The cuda.h...

Previous Next