Skip to content
Advertisement

Tag: c++

Compiler version in C++ vs pre-compiled C libraries

I have a code that uses std=c++20. I want to use a C library that was build with old gcc version. Should I recompile the C library using the same compiler ? If no, how could you judge that the 2 ABIs are compatible? Answer There should be no problem using the library as it is. Don’t forget to add

Protecting against Time-of-check to time-of-use?

I was reading: https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use They showed this code to be buggy and I totally understand why it’s so: But the real question is how to protect against this type of exploits? Answer You can use the O_NOFOLLOW flag. It will cause the open to fail if basename of the path is a symbolic link. That would solve the described attack.

Cannot compile Makefile using make command on Windows

Problem summary I am trying to install an open-source parallel finite-element code called TACS and available at this github repository. To comply with the indicated prerequisites, I followed the instructions at this github repository, which allowed me to install SuiteSparse and METIS on Windows with precompiled BLAS/LAPACK DLLs. For the MPI, I installed both the Intel MPI Library and Open

“/usr/bin/ld: cannot find -llibopencv_calib3d” when compiling an opencv project in Ubuntu 20.04

I have installed opencv in Ubuntu 20.04 following the instructions in OpenCV Installation in Linux. As per the instructions, sudo make install copies all the .so files to /usr/local/lib. However, when compiling a program, using the command g++ –std c++17 -g opencv/Basic.cpp -o output -I/usr/local/include/opencv4 -L/usr/local/lib/ -llibopencv_calib3d -llibopencv_core -llibopencv_dnn -llibopencv_features2d -llibopencv_flann -llibopencv_highgui -llibopencv_imgcodecs -llibopencv_imgproc -llibopencv_ml -llibopencv_objdetect -llibopencv_photo -llibopencv_stitching -llibopencv_video -llibopencv_videoio

Wayland client get compositor name

Is it possible for a c application using libwayland-client.so to get the name of the compositor / display server it opened a connection to (e.g. KWin, Sway, …)? I fail to find it in the docs. For reference, in X11 this is possible using XProps specified by EWMH: _NET_SUPPORTING_WM_CHECK to get the window id of the window manager and then

Trying to build C++ exe that uses .so that uses other .so files

I’m trying to build a C++ executable that links with a shared library, libA.so. libA.so was built and linked with another shared library, libB.so. libB.so was built using -rpath to look for a custom build of a system library in my home directory (liblapack.so). If I do a “readelf -d” on libB.so, I see liblapack.so as “NEEDED”, and I also

Advertisement