An error when combining compiled object files into executable code
66
votes
7answers
7k 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 them?
Feel free to edit/add your own.
24
votes
3answers
6k views
Link error while building a unit test target
I have a XCode4 / iOS project with a regular target and unit test target. Everything works fine, except when I try to #import one of my classes in my test class and try to use it. If I try to build ...
21
votes
3answers
19k views
Problem Linking Boost Library in Linux
I am trying to build a project using Boost's Asio and I am having some trouble. Initially, I tried to build the project without any additional libraries since everything is supposedly in the header ...
21
votes
4answers
449 views
Is this code broken or is there a bug in g++?
For some strange reason g++ (versions 4.5.0 and 4.5.2) cannot compile this code:
bool somefunc() {
return false;
}
class C {
public:
static const int a = 0;
static const int b = 1;
};
...
17
votes
1answer
6k views
Symbol not found: kUTTypeImage
I copied some bits of code from apple's documentation- and I got these 2 errors:
Undefined symbols for architecture i386:
"_kUTTypeImage", referenced from:
-[ImagePicker ...
15
votes
2answers
25k views
Trying to include a library, but keep getting 'undefined reference to' messages
I am attempting to use the libtommath library. I'm using the NetBeans IDE for my project on Ubuntu linux. I have downloaded and built the library, I have done a 'make install' to put the resulting ...
15
votes
6answers
8k 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
{
...
14
votes
3answers
16k views
Lua on iPhone?
I am trying to use Lua on the iphone.
On Mac OSX, in a normal Cocoa application (not iPhone), I used the following code:
lua_State* l;
l = lua_open();
luaL_openlibs(l);
luaL_loadstring(l, ...
13
votes
5answers
3k views
error during making GTest
I was trying to set up GTest environment on my Ubuntu machine. but while making the GTest to get the library, i get the following error...
som@som-VPCEH25EN:~/Workspace/CPP/gtest-1.6.0/make$ make
g++ ...
12
votes
5answers
9k views
“bad codegen, pointer diff” linker error with Xcode 4
Recompiling a C++ iPhone app with Xcode 4 I get this nasty linker error:
ld: bad codegen, pointer diff in __static_initialization_and_destruction_0(int, int)
to global weak symbol ...
11
votes
3answers
7k views
Linker errors in Android NDK (undefined reference to `__cxa_end_cleanup')
I'm getting this output after adding in a set of code from a colleague:
./obj/local/armeabi/objs/jniWrapper/native.o: In function `_Vector_base':
...
11
votes
1answer
25k views
linker error - linker input file unused because linking not done. then undefined reference to a function in that file
Ok so I'm having trouble with my linking of files.
Basically, my program works:
the main program, is gen1
gen1 - recieves input sends to str2value for processing, outputs resaults
str2value, brakes ...
10
votes
4answers
10k views
CUDA linking error - Visual Express 2008 - nvcc fatal due to (null) configuration file
I've been searching extensively for a possible solution to my error for the past 2 weeks. I have successfully installed the Cuda 64-bit compiler (tools) and SDK as well as the 64-bit version of Visual ...
10
votes
4answers
7k views
Apple Mach-O Linker Error armv7s & libGoogleAdMobAds.a
I've just upgraded my app to run on the new iPhone5 simulator, however when I try to build it for my iPhone 4S device, I get this Apple Mach-O Liner error.
ld: file is universal (3 slices) but ...
9
votes
3answers
7k views
Exporting static data in a DLL
I have a DLL which contains a class with static members. I use __declspec(dllexport) in order to make use of this class's methods. But when I link it to another project and try to compile it, I get ...