Questions tagged [linker-errors]

An error received when combining individually compiled object files into executable code.

Filter by
Sorted by
Tagged with
-3 votes
0 answers
30 views

How do I fix the Visual Studio 2022 LNK 1120 build error? [closed]

I was practicing Polymorphism in C++ and I started running the code but instead of the output, it showed the following message: Build started... 1>------ Build started: Project: CPPproject, ...
Ryan's user avatar
  • 1
0 votes
0 answers
55 views

Compiling C++ project with opencv using Cmake

I'm trying to build a simple C++ project that uses opencv to open an image, and when I build and run it from Visual Studio it works fine, but when i try using Cmake it gives a linking error. My ...
N0zye's user avatar
  • 1
0 votes
0 answers
20 views

Gcc not linking to objects in same static library

I am using gfortran (in the form of mpif90) to link a large mpi program. It all seems to be fine except for one library libgptl.a. The link step generates a number of errors but all of the form: ...
David Webb's user avatar
-2 votes
0 answers
37 views

Why does the linker not find the symbol? Is my template function incorrect? [duplicate]

I have the following simple code to implement a generic map-functionalty: // in Utils.h #include <iostream> class Utils { public: template <class S, class T> static std::vector<T&...
CocoaNut's user avatar
0 votes
1 answer
21 views

Compiling ns3 using clang results in undefined symbol linker error

I've downloaded ns-3.39, unpacked and compiled it using wget https://www.nsnam.org/releases/ns-allinone-3.39.tar.bz2 tar xfj ns-allinone-3.39.tar.bz2 cd ns-allinone-3.39/ns-3.39/ ./ns3 configure --...
kunterbunt's user avatar
0 votes
0 answers
23 views

Small data relocation error when linking, trying to read from stack

I am currently trying to implement a functionality for which I need to read values from stack memory locations. I am doing this by getting the address "__CPU_STACK" as an external, it is ...
haru's user avatar
  • 1
0 votes
0 answers
49 views

Why isn't VSCode linking to the raylib files correctly on my Mac?

I'm new to programming so excuse my poor knowledge if this problem is super easy to fix, but I wanted to have a go at using Raylib with C++ on VSCode (I'm using MacOS Sonoma 14.1), I followed this ...
RapidSpiders's user avatar
-4 votes
0 answers
51 views

linker error 2019(LNK2019) Visual studio 2022 [duplicate]

Iam having a problem in files in vs 2022 i made a class that have just functions prototypes and a cpp file that have the implemntation but i cant make any object of that class cuz of the linker error ...
Mohamad_T's user avatar
1 vote
1 answer
40 views

C++ Builder 11 linker problem - Unresolved external 'std::char_traits<char>::assign(char *, unsigned int, char)

I'm trying to revive an old project in C++Builder 11.3 (initially written in C++Builder 6). I'm using the 'classic' Borland compiler, which solves the wchar_t problem. But I'm getting this error: [...
nicemike2's user avatar
0 votes
0 answers
26 views

Can't use c32rtomb on MinGW, even though header is included

I have a project I made on Linux where I use the c32rtomb function found in uchar.h, and it works fine on Linux. But when I tried porting my project to windows using MinGW, I get this error: warning: ...
Abdulmalek Almkainzi's user avatar
-1 votes
0 answers
31 views

Templated class implementation in cpp [duplicate]

It gives error whenever I try to implement functions in cpp file. I tried many things and only instantiation in cpp worked, but it works for only predefined type so it's not a solution. How to fix it? ...
ÖZLEM ÇAVUŞOĞLU's user avatar
0 votes
0 answers
26 views

How does miniconda gcc handle glibc name resolution?

I have gcc 12.2 installed in miniconda env. In conda env there is a sysroot directory which contains libc.so.6 which links to libc-2.12.so. In my system directory there also is /lib64/libc.so.6 which ...
Xiaoyong Guo's user avatar
0 votes
0 answers
46 views

(ilink32 Error) Fatal: Unable to open file 'b:\c' - C++ Builder

I am making a small project for uni, and i've been stuck on this issue. Whenever i try to run my project, it keeps giving me this error. I don't know what kind of file this even is, and i certaintly ...
Borna's user avatar
  • 1
-1 votes
0 answers
40 views

error LNK2019: unresolved external symbol "public: class aiScene const * __cdecl Assimp::Importer::ReadFile

I'm getting link errors when using the assimp library, but I did add assimp-vc143-mtd.lib to my project. And they are both x64.The key code is as follows. Assimp::Importer imp; const aiScene* ...
林宸轩's user avatar
-1 votes
1 answer
51 views

LNK1104 when declaring a ifstream or ofstream variable

I try to open a file with ifstream but as soon as I try to declare a ifstream or ofstream variable I get LNK1104. The header works and the rest of the code also works. #include "sqlite/sqlite3.h&...
Thaval's user avatar
  • 9
-1 votes
1 answer
93 views

Executable doesn't see Vulkan dynamic lib and throws an linker-error LNK2019

I wanted to write an application in C++/Vulkan without requiring the pre-installed VulkanSDK. So, I have added through "git submodule" vulkan-headers repo, copy VulkanRT to binaries-...
Paulus's user avatar
  • 11
0 votes
0 answers
52 views

How do I integrate old Fortran/VS program into the new products?

I am trying to help with a project from work that was written with Fortran/C++. It is compiled on the native machine using ComposerXE-2011 and Visual Studio 11.0. I have installed on my home computer ...
Christopher Tokar's user avatar
1 vote
1 answer
85 views

Linking PnetCDF, NetCDF-C and NetCDF-Fortran libraries for an earth system model

I am trying to work on an earth system model and I am new to this. Currently, I am only trying to run a test case which is computationally less intensive. My system is Ubuntu 20.04. I have built the ...
Aatreyee's user avatar
0 votes
1 answer
62 views

Strange linking error that occurs only on MacOS

So, I have a interface library, that contains single singleton class and another class that is using it. Let's say that it contains following code: signleton.h struct Singleton {}; //< Singleton (...
CHOOISFOX's user avatar
0 votes
1 answer
43 views

Linker issues with msys2 mingw64 package library (libserialport) in Codelite - undefined reference

I am running some very simple experiments with the libserialport library installed through msys2 however, I run into linking problems no matter what configuration I set in the project settings. I am ...
Daniel Melendrez's user avatar
1 vote
0 answers
32 views

Why do I get linker errors when building ArrayFire examples

I am using the ArrayFire binaries provided by my Linux distro (Artix Linux, i.e. Arch Linux without Systemd). I want to build the examples, and I get linker errors. The library is installed here: > ...
Pietro's user avatar
  • 12.3k
0 votes
1 answer
39 views

Linking FFTW3 library to native Android Studio project

I want to link the static fftw3 library, which I built from source, to my native Android Studio application. Therefore I included the headers and added libfftw3.a (Mach-O 64-bit object arm64) to my ...
terdev's user avatar
  • 57
0 votes
1 answer
134 views

tensorflow_cc results in Undefined reference to `omp_in_parallel@VERSION'

I installed tensorflow-opt-cuda on Arch linux, but trying to link as g++ -fopenmp "CMakeFiles/intro-hello-world.dir/hello-world.cc.o" -o intro-hello-world /usr/lib/libtensorflow_cc.so /usr/...
Carlo Wood's user avatar
  • 5,896
0 votes
0 answers
56 views

Failing to statically link to OpenCV 4.7.0 using CMake

I have compiled OpenCV from scratch using BUILD_SHARED_LIBS=OFF. I've looked at the output and it seems to be correctly generating static libraries (.lib as I am on Windows). However, when I try to ...
Pedro's user avatar
  • 16
0 votes
0 answers
43 views

Defined a variable still getting an undefined reference error [duplicate]

x,y,z are 3 variables defined and declared in a function of radius_of_3_circles.c file. Once that function executes i.e. radius_x_y_z(); //line number 81 in code. The values of x,y,z get updated I ...
rachit juthani's user avatar
1 vote
1 answer
48 views

Are variables in .h file global variables

There is a tim.h file with 5 int variables:int a;int b ;int c ;int d ;int e; .I am including tim.h in a myfile.c file. myfile.c has 4 functions: void func1();void func2();void func3() ;void func4(); ...
rachit juthani's user avatar
0 votes
0 answers
44 views

Linker Error with packages installed through Conan

I am trying to get OpenCV to work with Conan but it doesn't work. I am on Windows 10. Default Conan profile: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=20 compiler.runtime=...
RedBox's user avatar
  • 152
0 votes
0 answers
110 views

How to use the module <format> of the c++20 standard with g++ 13.2.0 and Gnu Make 3.81 under Mac OS X Big Sur

After 5 days... Can nobody give me a hint what is wrong with that? I have not found a solution for this problem yet! ---vvv--- I just started to read about the C++20 standard and wanted to try out ...
pocahontius's user avatar
0 votes
1 answer
98 views

"error LNK2005: already defined in .obj" for inline definition

I'm on Microsoft Visual Studio Professional 2017 Version 15.6.6. I created a Visual C++ Empty Project and added the following: Foo.h: #pragma once struct Foo { static Foo F1; }; inline Foo Foo::F1;...
H.v.M.'s user avatar
  • 1,454
1 vote
0 answers
35 views

Template method of non-template class is not instantiating [duplicate]

I have a non-templated class with which I wish to use templated methods, with some specialisations. However, when compiling, the linker complains about the lack of the non-specialised template methods,...
paxdiablo's user avatar
  • 860k
0 votes
0 answers
49 views

CMake: Can't link to targets within same project

I am attempting to link library2 to library1, both of which are in the same source tree: MyProject ├── CMakeLists.txt ├── Library1 │ └── CMakeLists.txt │ └── include │ └── foo.h │ └── ...
Dominic Sesto's user avatar
0 votes
0 answers
35 views

Linking CXX shared library fails - undefined reference

I am trying to install the llvm compiler following their guide with the following options. cmake -S llvm -B build -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;...
Majo Belda's user avatar
0 votes
0 answers
56 views

Why do I not get a linker error in C++ when I am adding two variables with same name in the global scope in two different translation units? [duplicate]

Person.cpp #include <iostream> // using namespace std; int alpha = 5; int main() { std::cout << alpha << std::endl; } Person2.cpp int alpha = 10; The command I am using to ...
gbhardwaj00's user avatar
0 votes
1 answer
46 views

How to build program using custom header files, both using SFML library?

So, I was trying to create a custom header file, which will contain my implementation of several graphics functions like drawPixel,drawLine, etc.Both my source file(with main function), and header ...
Code Hard's user avatar
0 votes
0 answers
29 views

Why does the compilation process report "/usr/bin/ld: cannot find -lmysqlclient"

libmysqlclient has been insalled in "/usr/lib64/" such as: sudo find / -name 'libmysqlclient*' /usr/lib64/mysql/libmysqlclient_r.so /usr/lib64/mysql/libmysqlclient.so.18 /usr/lib64/mysql/...
wu jiqiang's user avatar
0 votes
0 answers
46 views

If there are two .cpp files in one project with the same variable declared, why linker shows no error if only one is static?

Let's say that we have two .cpp files: main.cpp and another.cpp, and they are both in one project. In main.cpp we create the global variable static int foo = 10 and in another.cpp we create int foo = ...
Szymon Nowaczyk - Słomian's user avatar
0 votes
1 answer
105 views

Unresolved external symbol when using vkSetDebugUtilsObjectNameEXT()? [duplicate]

Well i have changed some old function and after closing the Validationlayers tell me that i dont delete/clear up recources and now trying to set up DebugUtilsObjectName function to make it easier to ...
StarFox's user avatar
  • 15
0 votes
0 answers
47 views

System.NullReferenceException: Object reference not set to an instance of an object. from Firestore when linking is enabled

Here is my Xamarin.Forms code: IDocumentSnapshot myVariable = await CrossCloudFirestore.Current .Instance ...
Costas's user avatar
  • 479
0 votes
0 answers
79 views

Intermittent "Memory exhausted" linker issue

Facing bin/ld: final link failed: Memory exhausted linker issue intermittently while compiling 'C' code. I notice that there is enough memory available on build host while linking. But still hits into ...
vam's user avatar
  • 19
0 votes
0 answers
44 views

Rustup update broke linker

One day, I was installing cargo-binutils and llvm then I decided to update rustc and cargo.After I updated rustc and cargo with then command rustup udpate I can't compile any program anymore, it ...
Loaf's user avatar
  • 13
0 votes
0 answers
72 views

Why can't the compiler (gcc) recognise and diagnose a destructor missing a definition? [duplicate]

I spent too much time diagnosing a strange (yet, in hindsight, pretty straightforward) linker error that ended up being because a destructor in my base class was defined as: ~SomeClass(); instead of ~...
LNorth's user avatar
  • 68
0 votes
0 answers
29 views

When using imread, I can't build

I've made a project on esp-idf for the ESP32-CAM AIthinker, which uses a portable version of OpenCV seen in text. Everything seems to be working fine, except for the function imread(). Whenever I put ...
Daniel Bajo Collados's user avatar
2 votes
1 answer
654 views

Xcode 15 linker fails with undefined symbols but no symbols listed

I am rebuilding a project that was list build 2 years ago after upgrading to Xcode 15. Build fails with the following message: ... Undefined symbols: Linker command failed with exit code 1 (use -v to ...
user7143420's user avatar
0 votes
0 answers
47 views

Linking error when compiling Rust crate tinyaudio for Android

I'm trying to compile a library that uses a Rust crate tinyaudio, and I'm getting a linking error: ld: error: unable to find library -laaudio I have Android studio installed and: Android SDK ...
Dan S.'s user avatar
  • 79
0 votes
0 answers
160 views

Linker command failed with exit code 1 with Undefined symbol error

Im trying to run react native app with xcode 14.3.1. M2 MacBook pro, npm install and pod install is successfully done. but while running the app im getting this error. react native version is "...
Lakith Wijenayaka's user avatar
0 votes
0 answers
29 views

Compile gdb for os161 on Archlinux

I started following the os161 course, from ops-class, and I'm having trouble setting up part of the tool-chain required to do the exercises. I tried to follow the setup guide and managed to: install ...
cloud's user avatar
  • 1
1 vote
2 answers
78 views

MacOS x86_64 error with C/assembly language file: ld: symbol(s) not found for architecture x86_64 when compiling/linking assembly

I'm trying to compile this file from an open-source git repo: https://github.com/xcist/main/blob/master/gecatsim/clib_build/src/p_nlog_inline.c I'm on the MacOS x86_64 platform. OS v13.4 I can compile ...
hikerjobs's user avatar
  • 346
0 votes
0 answers
9 views

Linker error to boost library when catkin build the rtt_ros_integration from source [duplicate]

I am using Ubuntu 20.04, ROS Noetic. When I tried to install Orocos by following the instructions in readme, and try the catkin_make_isolated --install, following error happened: ==> Processing ...
Shengzhi Wang's user avatar
0 votes
0 answers
20 views

Error: CMake giving a linking error when all definitions are provided [duplicate]

I'm trying to compile a program with CMake, which is new to me, and it sucessfuly builds but fails in the linking stage. I have everything defined, so I'm not sure why it's failing. Here's the ...
Hoonter's user avatar
0 votes
0 answers
34 views

DEVC++ Makefil.win has changed. Reload from disk? ERROR

I just finished downloading the Dev C++ and my instructor told me follow his instructions (and so i did) but when i compile and run it it shows this error. idk how to fix it so can you help me? I have ...
ella belle's user avatar

1
2 3 4 5
79