Category : linker-errors

I´m trying to modify a piece of C++ code (developed under Linux with gcc toolchain) using in it new functions that are defined in two libraries, one shared library (called libsio4_api.so) and a static library (called sio4_main.a). The original code is built with a makefile that first creates a shared library linking toghether various object ..

Read more

As a mental exercise, I’m trying to write a program which links directly against the GPU driver of my Macbook Pro rather than using Apple’s Metal framework. Some exploration led me to this file (presumably specific to my particular hardware): /System/Library/Extensions/AMDRadeonX6000MTLDriver.bundle/Contents/MacOS/AMDRadeonX6000MTLDriver Running file on it confirms this is a Mach-O 64-bit dynamically linked shared library. ..

Read more

we are trying to build a c++ project for which we have been provided a build.sh file. We are getting a linking error as shown below. 66%] Linking CXX executable ../bin/rdiscoveryd /usr/bin/cmake -E cmake_link_script CMakeFiles/rdiscoveryd.dir/link.txt –verbose=1 g++-7 -Wno-psabi -rdynamic CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_discoveryd.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_riaps_actor.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_msghandler.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_dhttracker.cc.o CMakeFiles/rdiscoveryd.dir/src/utils/r_lmdb.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_validator.cc.o CMakeFiles/rdiscoveryd.dir/src/discoveryd/r_dhtdata.cc.o CMakeFiles/rdiscoveryd.dir/include/messaging/disco.capnp.c++.o -o ../bin/rdiscoveryd -L/usr/local/lib -Wl,-rpath,/usr/local/lib:/home/ubuntu/Desktop/riaps-core-master/bin: -lczmq -lzmq -lopendht -lgnutls ..

Read more

I’m simply trying to use functions from a C-libary (the Space Group library spglib) inside my C++ code. The library is already compiled and installed in an Anaconda environment. A minimal example looks like this: extern "C" { #include "spglib.h" } #include <iostream> static void test_spg_get_symmetry(void); int main(void) { test_spg_get_symmetry(); return 0; } static void ..

Read more

How do I convince VSCode to compile my C++ program with my own header files? I just can’t figure it out. Minimal example with the following directory structure: workdir/main.cpp workdir/test.h workdir/test.cpp Content of the main.cpp: #include <iostream> #include "test.h" int main() { std::cout << "Hello world!" << std::endl; print_stuff(); } Content of test.h: #pragma once ..

Read more