Questions tagged [undefined-reference]
A linker error caused by a missing definition of a symbol used elsewhere in a program
1,185
questions
1
vote
0
answers
56
views
Undefined Reference to cv::Mat::Mat when Compiling OpenCV in C++
I'm trying to compile a simple program using OpenCV 4.6.0 in C++ (I'm on Ubuntu 20.04 and that's the default installation) that reads an image, runs a BRISK feature detection, and displays the ...
0
votes
1
answer
54
views
Getting "undefined reference to `vtable`" error for parameterized constructor
I have this error coming up:
undefined reference to vtable
I'm unable to figure out the root cause of it.
I did try to search in Google, but still unable to figure out the reason.
Here is the code:
...
0
votes
0
answers
21
views
SDL Image "undefined reference to `IMG_LoadTexture` [duplicate]
I've got the following piece of code attempting to use SDL_image;
#include <iostream>
#define SDL_MAIN_HANDLED
#include <SDL.h>
#include <SDL_image.h>
int WIDTH = 800;
int HEIGHT = ...
2
votes
1
answer
113
views
Undefined Reference to Time::Time(int,int,int) [duplicate]
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 ...
0
votes
0
answers
45
views
undefined reference to va_start during the linking phase
Hi I'm trying to create an executable by linking multiple .so files in linux.
During the linker phase i'm getting undefined reference to `va_end' error in one of th e.so file i'm linking.
I tried to ...
-1
votes
1
answer
47
views
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 ...
0
votes
2
answers
53
views
Undefined reference to 'function' using CodeBlocks
I have the following error with a simple project to start learning with CodeBlocks.
E:\CodeBlocks\Projects\Triplet-CLEON-Benjamin\main.c|5|undefined reference to `initTriplet'|
C:\msys64\mingw64\bin\.....
0
votes
2
answers
77
views
How to add an outside library to an ESP-IDF Project
I've been trying to fix this for a couple days so any insight would be greatly appreciated. I am building a project with an ESP32 board and VSCode's esp-idf framework. I am having trouble getting ...
0
votes
1
answer
32
views
MongoDB insertOne function not found
I'm trying to use MONGODB in my project and I just started using it when it has this problem. I created another directory and ran the files with no problems whatsoever. What is wrong with this? I keep ...
0
votes
0
answers
42
views
Custom CMake library - What have I done wrong?
I am trying to install a custom library with CMake.
It consists of 2 'sub-libraries' and a main header file which includes the 'sub-libraries'.
I think it installs okay (The output looks like this:)
--...
2
votes
0
answers
52
views
undefined reference to `cv::Mat::Mat()'? [closed]
I am trying to setup opencv c++ with the help of cmake tool, and here are things that I have done.but I got some error,
my CMakeLists.txt is as follow,
cmake_minimum_required(VERSION 3.0.0)
project(...
0
votes
0
answers
17
views
GTK 3.0 : undefined reference to all the gtk library [duplicate]
I have a school project to do and I have a problem with my Makefile and the library.
This is my Makefile :
#Makefile
CC = gcc
CFLAGS = -g -Wall -Wextra ...
0
votes
0
answers
71
views
undefined reference to WinMain c programming language in vscode
Altough I save my project, I get these errors
When I run parametric_stack_arr.c I got this error
D:/Qt/Tools/mingw810_64/bin/../lib/gcc/x86_64-
w64-mingw32/8.1.0/../../../../x86_64-w64- mingw32/lib/.....
0
votes
0
answers
31
views
"undefined reference to" compile error for class implementation [duplicate]
I have implementation for two classes in four different files (separate .cpp/.cu and .h for each). The problem is that when I compile the code using this command:
$ nvcc -lcuda -lineinfo -o test -I ...
0
votes
0
answers
17
views
Is there any other way to display image without getting undefined onclick which is already rendered as template to html?
I am cretaing a small project related to managing books using db.json file as database. This is some of the code relevant to the actual problem
index.html
<body>
<ul class="books-...
1
vote
0
answers
41
views
C++ Undefined, Referenced Variable [closed]
Issue:
I have a common question that I'm trying to solve, but I cannot figure out why the solution I have isn't working. I'm receiving a LNK2001 error message for not having numOfShapes properly ...
2
votes
0
answers
149
views
Undefined symbol vs undefined reference
I saw this post here: ld: undefined symbol vs ld: undefined reference and I don't think it really talks about what the differences are between these 2 linker errors.
I usually get undefined reference ...
-2
votes
1
answer
46
views
C++ undefined reference to `findGrossPay(employeeInfo, double, int)'
A class I've been working on for a few days, running into an error I'm unsure how to fix.
#include <iostream> // for cin, cout, endl
#include <string>
#include <iomanip> ...
0
votes
0
answers
39
views
c++11 - inlining functions leads to undefined reference [duplicate]
I have a dummy class in Display.h:
#include <iostream>
#include <string>
class Display {
public:
Display(int w, int h, const std::string &title);
~Display();
};
In Display....
0
votes
1
answer
48
views
How to resolved undefined error to a function without adding static library path in eclipse(c,c++)
I have a function, e.g. add2num declared and defined in /dhaneesh/2021_pack/src/ path. I call the add2num function from /dhaneesh/new_pack/src/my_src.c. After compilation, it returns with error ...
0
votes
1
answer
51
views
How To Link External Dlls And More Specifically How To Manually Compile SDL? [duplicate]
Recently I stopped using IDEs in an attempt to learn more about the infrastructure of programming; I started compiling my C++ and C code with MinGW's compilers(g++.exe and gcc.exe accordingly) and the ...
0
votes
1
answer
71
views
mariadb-connector-cpp-1.0.1: Linking error for cjportedtests.exe
Environment
Windows 10
MinGW-W64 x86_64-ucrt-posix-seh, 11.2.0
cmake version 3.19.5
Error comes message as follows:
[ 74%] Linking CXX executable ..\cjportedtests.exe
c:/mingw64/bin/../lib/gcc/...
2
votes
1
answer
216
views
React ErrorBoundary doesn't catch "cannot read properties of undefined"
I faced a weird edge case with React ErrorBoundary. Exceptions are not being processed if they happen in inline expression. For example:
const page = webtexts[courseId].pages[pageFamilyId]; // Returns ...
0
votes
0
answers
99
views
Using pjsua2 with 3rd party media
I am trying to use pjsua (pjproject-2.10) for ubuntu(x86_64) system but I want to use a third party media library as per the instructions given in the link:
Integrating Third Party Media Stack into ...
2
votes
1
answer
83
views
Does this downcasting lead to undefined behavior?
Given this sample:
class Base
{
public:
void foo() {};
};
class Derived : public Base
{
};
int main()
{
Base b;
Derived* d = static_cast<Derived*>(...
0
votes
0
answers
26
views
How to fix implicit declaration and consequential problems when trying to install a C program on Linux (randfold-2.0)?
I am trying to compile randfold-2.0 on an HPC cluster I am working from, but am encountering troubles.
When I try the compilation using make I got the following error message:
*user@loginnode*:~/...
0
votes
0
answers
30
views
C++ Undefined reference to class, but it is referenced [duplicate]
I made this c++ Linked List project with CLion IDE and CMake. When I try to compile and run it, this error appears:
CMakeFiles\LinkedList.dir/objects.a(main.cpp.obj): In function `main':
D:/C++/...
0
votes
0
answers
46
views
Compiling Caffe: undefined reference
I'm trying to install caffe by following the instructions found here. But when compiling I get the following error:
$make all
CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
.build_release/...
1
vote
0
answers
171
views
[oneTBB]: undefined reference to tbb::detail::r1::xxxxx #802
with the usage:
ExternalProject_Add(tbb
PREFIX ${CMAKE_SOURCE_DIR}/deps
DOWNLOAD_NO_PROGRESS 1
DOWNLOAD_NAME v2021.4.0
# TODO: add wb cdn link
URL https://codeload.github.com/...
1
vote
1
answer
268
views
libtorch c++ undefined reference: DSO missing from command line
I'm trying to include libtorch in a c++ project to use a neural network I previously trained in python. But when I try to compile and link I get an error with an undefined reference issue and also '...
0
votes
0
answers
19
views
Undefined reference - Question about CmakeLists.txt Nlopt [duplicate]
Sorry to bother,
I installed and included nlopt library in .cpp file (#include <nlopt.hpp>) and still gives me this errors :
In function `nlopt::opt::~opt()':
undefined reference to `...
0
votes
0
answers
217
views
QT6+VTK9.1 on Windows build error: Undefined Reference to QVTKOpenGLStereoWidget
I have installed QT6 and successfully build VTK 9.1. I have added the following environment variables:
%QTDIR%\bin
%QTDIR%\lib
%VTK_DIR%\bin
where QTDIR points to C:\Qt\6.2.3\msvc2019_64 and VTK_DIR ...
0
votes
0
answers
31
views
"Undefined reference to" error when trying to link external (OpenGL) libraries with g++ [duplicate]
I am trying to build two c++ files. These include the GLFW and GLEW libraries, as I'm trying to write OpenGL code. App.cpp is the main file, and loadShader.cpp is the implementation file of loadShader....
0
votes
0
answers
31
views
How can I get this code running even though there is no syntax error? I keep on getting an "undefined reference" error [duplicate]
When I am doing my C++ project on this linked list, one of the problems I face is getting this error message on the output terminal:
main.cpp:(.text+0x4d): undefined reference to 'insert(Node*&, ...
0
votes
0
answers
193
views
Undefined reference error occurs when buildingproject that uses blufi library
I am working on converting a project from platformio (idf + arduino) to pure IDF (with arduino as a component) in order to be able to use the latet (4.4) version of IDF with the (finally!) officially ...
-1
votes
1
answer
488
views
"Undefined reference to" functions declared in header and implemented in cpp file [duplicate]
I am getting "undefined reference to" error for every function I am trying to use from the header file. The code works fine when i copy the function bodies directly into "main.cpp",...
0
votes
1
answer
41
views
Running Ruby in C compile and link issues
I've been trying all day to build and run a simple Ruby inside of C program.
This is a recurring topic here, and none of them are identical to my issue nor have any of the solutions helped me. I have ...
2
votes
1
answer
116
views
Thick binding dynamic library: Undefined references
What I did so far on my Linux Mint system:
Write a thin binding to the GSL library
Write a thick binding based on the thin binding
Write a test program for 1.
Write a test program for 2.
When I ...
0
votes
1
answer
198
views
undefined reference to `Class::Function() / error: Id returned 1 exit status [duplicate]
I'm trying to initialize value, I follow Bjarne Stroustrup's book but cannot run this code.
#include <iostream>
using namespace std;
struct Date
{
int y, m, d; // year, month,...
0
votes
0
answers
35
views
c++ compiler returning undefined reference when referencing "CreateBitmap()" [duplicate]
I am very new to c++ and I cant seem to get this code to work:
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
HBITMAP hbm = CreateBitmap(100, 100, 1, 24, ...
0
votes
0
answers
235
views
Tesseract - NameError: name 'Output' is not defined [duplicate]
I'm using tesseract for the OCR part , but I've run into a small setback with defining the output. Could anyone help me out in resolving this issue
details = pytesseract.image_to_data(threshold_img, ...
0
votes
1
answer
291
views
CMake: undefined symbol when linking an executable with an OBJECT target which linked to a Shared Library
To be summarized, I have an Object target (a_object) which is PUBLIC linked to a Shared Library (base). The Object target is compiled fine, however when I link that Object target to an executable (...
-1
votes
1
answer
458
views
Undefined reference to stdscr [duplicate]
I want to compile a C code in the latest version of ubuntu. when I do this, I get the following error:
gcc <fileName>.c
/usr/bin/ld: /tmp/ccY8CJ10.o: in function `main':
sudoku.c:(.text+0xb8): ...
0
votes
2
answers
64
views
Error passing instances to library functions
I'm having a problem with pointers.
I'm trying to create a custom Touch Keyboard library, using MCUFRIEND_kbv TFT library.
When I try to pass the pointer of the TFT instance (found in main.cpp as tft ...
-1
votes
1
answer
46
views
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
0
votes
0
answers
17
views
Undefined reference to methods of a class defined by non-type template parameters [duplicate]
Good day all,
I'm trying to understand templates in C++, but there is something I must be missing. The goal is to use fixed-size arrays inside a class, and I must therefore define their length as a ...
2
votes
0
answers
112
views
While training throws up a huge compile time error which says TLS init function undefined reference to arma::mt19937_64_instance
The undefined reference is generally a linker error. I feel like the error is because of my compilation of mlpack rather than code but I do not know how to track it down or if my assumption is correct....
0
votes
0
answers
14
views
How can I make a function with infinite numbers of the same type parameters? [duplicate]
So I wanted to know if there was an "easy" way to make a function that doesn't have a set amount of parameters. Especially in my case, the parameters would all be the same type.
I've seen ...
0
votes
0
answers
25
views
Undefined reference to struct method in another .cpp file [duplicate]
As the title says. I have this exact problem with my bigger project, but I decided to check for the same issue on this little test model. It turns out the issue is still present and I've tried ...
1
vote
1
answer
93
views
Undefined reference to initialized static member variable with make_shared
Compiling with -std=c++14 the following code:
#include <memory>
class A
{
public:
static constexpr int c = 0;
std::shared_ptr<int> b;
A() {
b = std::make_shared&...