Questions tagged [undefined-symbol]

After all of the input files have been read and all symbol resolution is complete, the link-editor searches the internal symbol table for any symbol references that have not been bound to symbol definitions. These symbol references are referred to as undefined symbols. Undefined symbols can affect the link-edit process according to the type of symbol, together with the type of output file being generated.

Usually the errors related to are mean this:

It means you haven't written a function, or you haven't created a variable, or you haven't linked against the library or object code that contains the missing function or variable.

It means the linker has looked through all the compiled code you told it to, and it still can't find what it's looking for.


Source0 and Source1

417 questions
8
votes
2 answers

Undefined symbols error when using a header file

I'm getting the following error and can't for the life of me figure out what I'm doing wrong. $ gcc main.c -o main Undefined symbols: "_wtf", referenced from: _main in ccu2Qr2V.o ld: symbol(s) not found collect2: ld returned 1 exit…
Chris Cummings
  • 2,007
  • 5
  • 25
  • 39
7
votes
1 answer

How to use -v invocation to see details on cmake linker error (undefined symbols)?

How specifically do I use the -v invocation to see details on a cmake linker error? I found two existing questions about using this option, but one is for Xcode builds and the other for NDK builds. They are here: use -v to see invocation? How to…
Alyoshak
  • 2,696
  • 10
  • 43
  • 70
7
votes
2 answers

Getting "Undefined symbols" when trying to use EventKit?

I am trying to use EventKit based around the doco & SimpleEKDemo application, however I am getting the following single error. What does this error mean and what steps would be recommended for troubleshooting (first time I've had such a linking…
Greg
  • 34,042
  • 79
  • 253
  • 454
7
votes
1 answer

Undefined symbols for architecture x86_64 for Boost C++

I was trying to compile the following simple thread example for the Boost library: #include #include #include using namespace std; void thread() { …
busebd12
  • 997
  • 2
  • 12
  • 24
7
votes
2 answers

CentOS: Using GCC 4.7 from devtoolset results in linking libstdc++ incorrectly (undefined symbols)

I am using the devtoolset-1.0 for CentOS 6.3 in order to upgrade temporarily the GCC version. Although I am now able to compile my C++ application, the final binary is missing some symbols: $ ldd -d -r myapp $ [..] $ libstdc++.so.6 =>…
labrassbandito
  • 535
  • 12
  • 25
7
votes
2 answers

How to add files to Xcode project? (writing Unity plugin)

I bet my problem is very basic, so please excuse me as I'm not that experienced with Xcode, since I work in Unity and use ready plugins for our iOS projects, so not really needed to go deep in Xcode until now. I want to write a very basic custom…
user1634098
  • 71
  • 1
  • 3
6
votes
2 answers

Java: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE

I've been working on a Java project that uses a gui.jar file to import some classes. Everything was working fine until yesterday. Now, I can compile the .class files by the command javac -d ./bin -sourcepath ./src -classpath ./bin/gui.jar…
6
votes
1 answer

Mac OS X App backwards compatibility 10.6 and 10.7 while using NSPopovers

What is the best way to implement backwards compatibility, when building an app for Mac OS X 10.7 but also staying compatible for 10.6? I have an application that uses an NSPopover when the client is 10.7 and an NSMenu when the client is 10.6. The…
ovm
  • 2,452
  • 3
  • 28
  • 51
6
votes
3 answers

again "undefined symbol" in runtime, c++

I have a data type and I can instantiate a variable of that type. like this: FetchAddr faddr(VirtualMemoryAddress( 0x0a )); The definition of FetchAdr is: struct FetchAddr { VirtualMemoryAddress theAddress; FetchAddr(VirtualMemoryAddress…
mahmood
  • 23,197
  • 49
  • 147
  • 242
6
votes
2 answers

nm symbol both "U" and "T", what does that mean?

I am having an undefined symbol error at runtime, and when I look for the symbol in the relevant library, I get the result: nm -C -D /home/farmer/anaconda3/envs/general/lib/python3.6/site-packages/pyscannerbit/libScannerBitCAPI.so | grep empty_ …
Ben Farmer
  • 2,387
  • 1
  • 25
  • 44
6
votes
2 answers

How to determine inter-library dependencies?

My project consists of a couple of static libraries, which are linked together in a final step. Now I have the problem, that the link order of the library is important (otherwise I get an undefined symbol linker error). Sometimes I run into the…
Charly
  • 1,270
  • 19
  • 42
6
votes
4 answers

How do I compile and link C++ code with compiled C code?

I want to be able to use Cmockery to mock C functions called from C++ code I'm testing. As a step towards that, I've renamed the Cmockery example run_tests.c to run_tests.cpp, and am attempting to compile and link it with cmockery.c: g++ -m32…
Daryl Spitzer
  • 143,156
  • 76
  • 154
  • 173
6
votes
1 answer

libg2o linker errors on OS X

I am getting the following linker errors: cd /Users/mhoggan/Development/bluenote/image_pose_adjustment/image_pose_adjustment/native/graph/cmake-build-debug/src && /Applications/CLion.app/Contents/bin/cmake/bin/cmake -E cmake_link_script…
Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140
6
votes
1 answer

Undefined symbols for architecture x86_64: "_CFRelease"

I am quite new to the Unix world and I am trying to install a software called Meep for physics simulations. To get this I need to install a lot of libraries on my Mac OS X 10.10.5; I succeeded in many of them but I had the following error while…
G.Gatti
  • 61
  • 1
  • 2
6
votes
1 answer

Separate definitions of variadic templates

(Final question at the bottom) Recently, I asked a question concerning how I would fix linker errors (on duplicate symbols concerning multiple definitions of a template void. Because I was using the functions in multiple source files, I was…
hpm
  • 1,202
  • 13
  • 34
1
2
3
27 28