Category : linker

I wanted to build a gtest project on linux using just a makefile, ie not using cmake. I followed along the tutorial here: http://www.yolinux.com/TUTORIALS/Cpp-GoogleTest.html But getting multiple definition of main errors – see below. I am on ubuntu v20.04 [email protected]:~/Documents/code/gtest_make_only/test/src$ uname -a Linux angus-VirtualBox 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 ..

Read more

I’m currently trying to use TGUI with SFML as the backend, everything works fine when I had this code #include <iostream> #include <TGUI/TGUI.hpp> int main() { sf::RenderWindow window{ {800, 600}, "TGUI window with SFML" }; tgui::GuiSFML gui{ window }; gui.loadWidgetsFromFile("menus/startMenu.txt"); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { gui.handleEvent(event); if (event.type == sf::Event::Closed) { window.close(); ..

Read more

I installed opencv with brew install opencv. Added the pkg-config: $ pkg-config –cflags –libs opencv4 -I/usr/local/opt/opencv/include/opencv4 -L/usr/local/opt/opencv/lib -lopencv_gapi -lopencv_stitching -lopencv_alphamat -lopencv_aruco -lopencv_barcode -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_sfm -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio ..

Read more

I’m having a C++ project where I’m loading a Saved Model and want to do some inference. Now I have the followin code: Status status = LoadSavedModel(session_options, run_options, "final", { kSavedModelTagServe }, &model_bundle); auto sig_map = model_bundle.GetSignatures(); auto model_def = sig_map.at("serving_default"); for (auto const& p : model_def.inputs()) { std::cout << p.first.c_str() << std::endl; std::cout << ..

Read more

A variable is declared as volatile bool is_usage_mode_convenience_activated = true; It shows up in the linker map file with proper address but I cannot find it in the ELF symbol table (examined with readelf). The dwarf debug info (readelf –debug-dump=info) is as follows <2><42019>: Abbrev Number: 104 (DW_TAG_variable) <4201a> DW_AT_name : (indirect string, offset: 0x433aa): ..

Read more

I’m struggling for several days with a strange problem. I narrowed it down to the following line: /home/nc/.benv/tools/linaro-l4t/Linux_7.5.0-2019.12/bin/aarch64-linux-gnu-g++ –sysroot=/home/nc/.benv/tools/linaro-l4t/Linux_7.5.0-2019.12/sysroot #1 CMakeFiles/cuda_hello_world.dir/src/test.cpp.o -o bin/cuda_hello_world -L/home/nc/.benv/tools/linaro-l4t/Linux_7.5.0-2019.12/aarch64-linux-gnu/libc/usr/lib #2 -lpthread ^ I’ll refer to the paths in the future as #1 and #2 to keep space. I’m trying to cross-compile an application and this is what CMake generates for ..

Read more

In an embedded C++ context, I have defined a separate linker section in flash memory, far away from the rest of the code/data, in which I store data that the user may modify at runtime. (EEPROM emulation, basically) I also have a custom device firmware updater, that’s going to overwrite the read-only code/data in flash, ..

Read more