Questions tagged [undefined-reference]

A linker error caused by a missing definition of a symbol used elsewhere in a program

The most common causes are

  • Declaring but not defining a function, global variable or static data member
  • Not compiling or linking to an object file that contains the definition of a symbol
  • Forgetting to link to the library that provides the symbol
  • Listing a required library before the objects that depend on it (in the linker command libraries should be listed after the objects that depend on them)

There is a C++ FAQ question about undefined references in C++ and how to solve them.

1243 questions
0
votes
1 answer

jQuery reaching document.ready() despite .holdReady() call. Slickgrid error - Slick is not defined (5 out of range 4) error - dependencies

In the following script utilizing jQuery and slickGrid, I keep getting an error saying Slick is not defined (5 out of range 4) or Slick is not defined (6 out of range 4) - Both in FireBug, and in Chrome I get: Uncaught ReferenceError: Slick is not…
0
votes
2 answers

Undefined References and Segmentation Faults

Ok, I'm writing a program which uses several different classes, including a Linked Sorted List, and a Binary Search Tree/Node class. When I compile in Visual Studio, it runs with no complaints at all, 100% smooth, and I have completely debugged it…
0
votes
1 answer

C++ undefined reference

Hi in my program I have two constructors; BinaryImage(); BinaryImage(int MM, int NN, double* input_data, double thresh); In my main; BinaryImage BinaryImageObj(); This compiles fine but when I invoke the second construtor; BinaryImage…
nullVoid
  • 199
  • 1
  • 6
  • 24
0
votes
1 answer

gcc throws: undefined reference to `_getcwd'

I'm trying to compile this sourceforge-project in ubuntu 11.10 x64: http://vmb.sourceforge.net/ Linux users have to compile the devices from sources. Either obtained from cvs (see: http://sourceforge.net/projects/vmb/) or as a tgz file. The sources…
Reini
  • 1,233
  • 3
  • 19
  • 34
0
votes
3 answers

C++ Header and Source Directories

I have the following files: listDriverTest.cpp src/List.cpp headers/List.h The include in List.cpp is #include "../headers/List.h" The include in listDriverTest.cpp is #include "headers/List.h" When I compile with the following statement, g++…
Tanaki
  • 2,575
  • 6
  • 30
  • 41
0
votes
2 answers

"undefined reference to PrintArgv": why?

When I compile my program, I get three "undefined reference to 'PrintArgv(...)'" errors. I have searched but I cannot find the reason why I am getting these errors. Here is my code: #include "tools.hpp" enum ARG_T {COMMAND, SWITCH,…
DFord
  • 2,352
  • 4
  • 33
  • 51
0
votes
8 answers

C++ - Undefined reference to a class recently created !

I just created this new class : //------------------------------------------------------------------------------ #ifndef MULTITHREADEDVECTOR_H #define…
Amokrane Chentir
  • 29,907
  • 37
  • 114
  • 158
-1
votes
1 answer

Undefined Reference to Time::Time(int,int,int)

An error appeared while I was testing the driver code. The compiler raised such an error: undefined reference to Time::Time(int, int, int) AND undefined reference to Time::setTime(int, int, int) Why did the Code::Blocks IDE raise this error? Is it…
-1
votes
1 answer

How to build and run OpenSubdiv Tutorials/examples

I'm trying to experiment with the OpenSubdiv C++ library. I'm not an experienced C++ programmer. The OpenSubdiv library has some tutorials that I'd like to get working, but I can't figure out how. So far, I have installed OpenSubD and dependencies…
GeneralPancake
  • 535
  • 2
  • 6
  • 15
-1
votes
1 answer

c++ undefined reference

I am getting an undefined reference error: /afs/ec.auckland.ac.nz/users/c/s/cshe079/unixhome/Desktop/306P1/ARToolKit/examples/simple/simpleTest.cc:161: undefined reference to `affine_transformation_range::~affine_transformation_range()' collect2: ld…
Christian
  • 13
  • 3
-1
votes
1 answer

An error occurred while using the gcc command

"undefined reference to 'func~'" error.. I'm new to that program, so I can't figure out the reason for the error. enter image description here
JSolo
  • 3
  • 1
-1
votes
1 answer

MinGW32 can't configure sources: "undefined reference to `signal' and etc

Last year I builded some sources on MinGW without any problem. Now when I try to reconfigure this souces with another parameters I get (part of output of ./configure of libjansson-2.10 in config.log): configure:3318: checking whether the C compiler…
javierMarquez
  • 142
  • 2
  • 10
-1
votes
1 answer

Compiles error:Undefined reference, which is caused mainly by dependency with libraries?

I met a c++ compile error that almost drives me mad these days. The output info is (/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: undefined reference to symbol…
caiyi.zcy
  • 1
  • 1
-1
votes
1 answer

Getting undefined reference error from makefile

I am working on a project that uses some code written by someone else inside a folder called CommandParser. My project is called TCP_IP and inside it there is the CommandParser folder. This is my makefile. TARGET = $(BIN_DIR)/sim_tcp_ip LIBS =…
EmTor
  • 107
  • 9
-1
votes
1 answer

Auto-dependency generation in Makefile: undefined reference to `main' (mixing conda channels)

I would like to add dependencies to a Makefile of mine such that every time a header is modified the correspondent translation unit is recompiled. Currently only changes to source files are considered. I followed this example quite closely. Below…
unvarnished
  • 95
  • 1
  • 8