How to add Boost.Move library to CMakelists.txt? - c++

Cannot compile C++ program, apparently because Boost.Move library is not added as dependency. Compilation errors related to unique_ptr. In the program I have several boost libraries as dependencies which I successfully added except boost.move. Went through a pile of examples and code, didn't file any specific examples on how to add it to CMakelists.txt.
Insets in my .cpp program (that's what it appears to be causing issues not having all dependencies):
#include <boost/move/unique_ptr.hpp>
...
boost::movelib::unique_ptr<plctag> _plctag;
...
My boost dependencies in CMakeLists.txt:
find_package(Boost REQUIRED COMPONENTS log thread)
Compilation errors, is it really what I'm thinking?:
path///.cpp:100:46: error: wrong number of template arguments (1, should be 2)
100 | boost::movelib::unique_ptr<plctag> _plctag;
| ^
In file included from /usr/include/boost/smart_ptr/shared_ptr.hpp:28,
from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/boost/date_time/time_clock.hpp:17,
from /usr/include/boost/thread/thread_time.hpp:9,
from /usr/include/boost/thread/lock_types.hpp:18,
from /usr/include/boost/thread/pthread/mutex.hpp:16,
from /usr/include/boost/thread/mutex.hpp:16,
path///.hpp:4,
path///.cpp:8:
/usr/include/boost/smart_ptr/detail/shared_count.hpp:58:36: note: provided for ‘template<class T, class D> class boost::movelib::unique_ptr’
58 | template< class T, class D > class unique_ptr;
| ^~~~~~~~~~
path///.cpp:102:21: error: request for member ‘reset’ in ‘_tag’, which is of non-class type ‘int’
102 | _tag.reset();
| ^~~~~
path///.cpp:108:20: error: base operand of ‘->’ is not a pointer
108 | _tag->write_tag_str();
| ^~
path///.cpp:111:27: error: base operand of ‘->’ is not a pointer
111 | string_vec = _tag->read_tag_str();
| ^~
path///.cpp:125:20: error: base operand of ‘->’ is not a pointer
125 | _tag->write_tag();
| ^~
path///.cpp:128:27: error: base operand of ‘->’ is not a pointer
128 | float_vec = _tag->read_tag();
Maybe I don't understand something. Pretty much a beginner at this point. Thanks for help

Related

SDL_Vertex and SDL_RenderGeometry not found

I made a project with SDL2 under Windows.
When I try to compile it on Linux, these errors occur:
reilbas#reilbas:~/C/a/Labyrinthe-3D-main$ g++ -o test -I include src/*.cpp $(sdl2-config --cflags --libs)
src/Affichage.cpp: In member function ‘void Affichage::drawRect(float, float, float, float, SDL_Color&)’:
src/Affichage.cpp:110:17: error: ‘SDL_Vertex’ was not declared in this scope; did you mean ‘SDL_mutex’?
110 | std::vector<SDL_Vertex> triUi1 = {
| ^~~~~~~~~~
| SDL_mutex
src/Affichage.cpp:110:27: error: template argument 1 is invalid
110 | std::vector<SDL_Vertex> triUi1 = {
| ^
src/Affichage.cpp:110:27: error: template argument 2 is invalid
src/Affichage.cpp:110:29: error: scalar object ‘triUi1’ requires one element in initializer
110 | std::vector<SDL_Vertex> triUi1 = {
| ^~~~~~
src/Affichage.cpp:115:27: error: template argument 2 is invalid
115 | std::vector<SDL_Vertex> triUi2 = {
| ^
src/Affichage.cpp:115:29: error: scalar object ‘triUi2’ requires one element in initializer
115 | std::vector<SDL_Vertex> triUi2 = {
| ^~~~~~
src/Affichage.cpp:120:5: error: ‘SDL_RenderGeometry’ was not declared in this scope; did you mean ‘SDL_RenderCopy’?
120 | SDL_RenderGeometry(renderer, nullptr, triUi1.data(), triUi1.size(), nullptr, 0);
| ^~~~~~~~~~~~~~~~~~
| SDL_RenderCopy
src/Affichage.cpp: In member function ‘void Affichage::displayTri(std::vector<triangle>)’:
src/Affichage.cpp:146:21: error: ‘SDL_Vertex’ was not declared in this scope; did you mean ‘SDL_mutex’?
146 | std::vector<SDL_Vertex> verts = {
| ^~~~~~~~~~
| SDL_mutex
src/Affichage.cpp:146:31: error: template argument 1 is invalid
146 | std::vector<SDL_Vertex> verts = {
| ^
src/Affichage.cpp:146:31: error: template argument 2 is invalid
src/Affichage.cpp:146:33: error: scalar object ‘verts’ requires one element in initializer
146 | std::vector<SDL_Vertex> verts = {
| ^~~~~
src/Affichage.cpp:151:9: error: ‘SDL_RenderGeometry’ was not declared in this scope; did you mean ‘SDL_RenderCopy’?
151 | SDL_RenderGeometry( renderer, nullptr, verts.data(), verts.size(), nullptr, 0);
| ^~~~~~~~~~~~~~~~~~
| SDL_RenderCopy
src/AllMath.cpp: In static member function ‘static int AllMath::triangleClipAgainstPlane(vec3d, vec3d, triangle&, triangle&, triangle&)’:
src/AllMath.cpp:254:1: warning: control reaches end of non-void function [-Wreturn-type]
254 | }
| ^
I installed SDL2 with apt:
$ sudo apt-get install libsdl2
SDL_RenderGeometry() & friends were introduced in SDL 2.0.18:
Added SDL_RenderGeometry() and SDL_RenderGeometryRaw() to allow rendering of arbitrary shapes using the SDL 2D render API
...so make sure you're using that version or higher.
SDL 2.0.18 was released in late 2021 so distros like Ubuntu 20.04 that ship older versions of SDL won't have those newer functions.

How to define an object in the header file and initialize it in the source file

I have an object qp that is defined as
#include <proxsuite/proxqp/dense/dense.hpp>
namespace fr3_ros {
class WaypointController : public controller_interface::MultiInterfaceController<franka_hw::FrankaModelInterface,
hardware_interface::EffortJointInterface,
franka_hw::FrankaStateInterface> {
...
private:
proxsuite::proxqp::isize dim = 14;
proxsuite::proxqp::isize n_eq = 7;
proxsuite::proxqp::isize n_in = 0;
proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
...
}
From the documetation here controller_interface::MultiInterfaceController has the constructor
MultiInterfaceController (bool allow_optional_interfaces=false)
Since I did not define a new constructor, that would be the only constructor WaypointController has.
However, if I put this in the header file it would give me an error when compiling:
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:43: error: ‘dim’ is not a type
113 | proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
| ^~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:48: error: ‘n_eq’ is not a type
113 | proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
| ^~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:54: error: ‘n_in’ is not a type
113 | proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
| ^~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp: In member function ‘virtual void fr3_ros::WaypointController::update(const ros::Time&, const ros::Duration&)’:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:225:5: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
225 | qp.update(qp_H, qp_g, qp_A, qp_b, std::nullopt, std::nullopt, std::nullopt);
| ^~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:227:5: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
227 | qp.init(qp_H, qp_g, qp_A, qp_b, std::nullopt, std::nullopt, std::nullopt);
| ^~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:230:3: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
230 | qp.solve();
| ^~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:232:13: error: invalid use of member function ‘proxsuite::proxqp::dense::QP<double> fr3_ros::WaypointController::qp(int, int, int)’ (did you forget the ‘()’ ?)
232 | torques = qp.results.x.bottomLeftCorner(7, 1);
| ^~
I also tried separating the declaration and definition, in the header file I have
proxsuite::proxqp::isize dim = 14;
proxsuite::proxqp::isize n_eq = 7;
proxsuite::proxqp::isize n_in = 0;
proxsuite::proxqp::dense::QP<double> qp;
and in the source file I have
qp = proxsuite::proxqp::dense::QP<double>(dim, n_eq, n_in);
this gives me another error
In file included from /opt/ros/noetic/include/class_loader/class_loader_core.hpp:45,
from /opt/ros/noetic/include/class_loader/class_loader.hpp:46,
from /opt/ros/noetic/include/pluginlib/class_list_macros.hpp:40,
from /opt/ros/noetic/include/pluginlib/class_list_macros.h:35,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:13:
/opt/ros/noetic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = fr3_ros::WaypointController; B = controller_interface::ControllerBase]’:
/opt/ros/noetic/include/class_loader/meta_object.hpp:196:7: required from here
/opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: use of deleted function ‘fr3_ros::WaypointController::WaypointController()’
198 | return new C;
| ^~~~~
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: note: ‘fr3_ros::WaypointController::WaypointController()’ is implicitly deleted because the default definition would be ill-formed:
36 | class WaypointController : public controller_interface::MultiInterfaceController<franka_hw::FrankaModelInterface,
| ^~~~~~~~~~~~~~~~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: error: no matching function for call to ‘proxsuite::proxqp::dense::QP<double>::QP()’
In file included from /home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/dense.hpp:8,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:31,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate: ‘proxsuite::proxqp::dense::QP<T>::QP(proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize) [with T = double; proxsuite::linalg::veg::isize = long int]’
94 | QP(isize _dim, isize _n_eq, isize _n_in)
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate expects 3 arguments, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(const proxsuite::proxqp::dense::QP<double>&)’
81 | struct QP
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(proxsuite::proxqp::dense::QP<double>&&)’
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
If I add extern in the header file, I get the error
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:113:3: error: storage class specified for ‘qp’
113 | extern proxsuite::proxqp::dense::QP<double> qp;
| ^~~~~~
In file included from /opt/ros/noetic/include/class_loader/class_loader_core.hpp:45,
from /opt/ros/noetic/include/class_loader/class_loader.hpp:46,
from /opt/ros/noetic/include/pluginlib/class_list_macros.hpp:40,
from /opt/ros/noetic/include/pluginlib/class_list_macros.h:35,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:13:
/opt/ros/noetic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = fr3_ros::WaypointController; B = controller_interface::ControllerBase]’:
/opt/ros/noetic/include/class_loader/meta_object.hpp:196:7: required from here
/opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: use of deleted function ‘fr3_ros::WaypointController::WaypointController()’
198 | return new C;
| ^~~~~
In file included from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: note: ‘fr3_ros::WaypointController::WaypointController()’ is implicitly deleted because the default definition would be ill-formed:
36 | class WaypointController : public controller_interface::MultiInterfaceController<franka_hw::FrankaModelInterface,
| ^~~~~~~~~~~~~~~~~~
/home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:36:7: error: no matching function for call to ‘proxsuite::proxqp::dense::QP<double>::QP()’
In file included from /home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/dense.hpp:8,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/include/fr3_ros/waypoint_controller.h:31,
from /home/bolun/bolun_ws/src/fr3_ros/fr3_ros/src/waypoint_controller.cpp:1:
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate: ‘proxsuite::proxqp::dense::QP<T>::QP(proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize, proxsuite::linalg::veg::isize) [with T = double; proxsuite::linalg::veg::isize = long int]’
94 | QP(isize _dim, isize _n_eq, isize _n_in)
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:94:3: note: candidate expects 3 arguments, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(const proxsuite::proxqp::dense::QP<double>&)’
81 | struct QP
| ^~
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate: ‘proxsuite::proxqp::dense::QP<double>::QP(proxsuite::proxqp::dense::QP<double>&&)’
/home/bolun/miniconda3/envs/fr3_env/include/proxsuite/proxqp/dense/wrapper.hpp:81:8: note: candidate expects 1 argument, 0 provided
Is it possible for someone to help me understand what is the issue here? Is the a universal issue in C++ or is it just this package?
Thanks in advance!
If I were to intialize qp using a member initialize list, should it look like:
public:
WaypointController()
: dim(14), neq(7), n_in(0), qp(dim, n_eq, n_in)
{
}
The error message you're getting is not particularly helpful here, but let me explain it anyways, so you understand what's going on.
C++ believes that you're trying to declare a function, not define a variable.
proxsuite::proxqp::dense::QP<double> qp(dim, n_eq, n_in);
The return type is proxsuite::proxqp::dense::QP<double>, the function's name is qp, and it takes 3 parameters, of types dim, n_eq, and n_in.
The fact that this is not what you intended in entirely irrelevant.
Knowing this, your error messages make a lot more sense.
The solution to this is to declare the field in the header file, like so:
proxsuite::proxqp::dense::QP<double> qp;
And then to you need to initialize qp in your constructor. Use a member initialization list for this.

OpenCV createsamples.cpp debugging

The newest version of OpenCV(4) does not come with createsamples feature for creating HAAR CASCADE files. It's just mind boggling. To attain this feature, there are two solutions: 1) Download an older version on a different machine or 2) Compile createsamples.cpp I am choosing item two as anyone can settle for kluge anytime. Item two comes with many errors that look the same as shown below:
harry#harry-usedmachine:/usr/include/opencv4$ sudo g++ createsamples.cpp
[sudo] password for harry:
In file included from createsamples.cpp:48:
/usr/include/opencv4/opencv2/core.hpp:2523:16: error: ‘FileStorage’ has not been declared
2523 | void write(FileStorage& fs) const;
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp:2573:15: error: ‘FileStorage’ has not been declared
2573 | void save(FileStorage& fs) const;
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp:2577:21: error: ‘FileStorage’ does not name a type
2577 | void load(const FileStorage& node);
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp:3088:24: error: ‘FileStorage’ has not been declared
3088 | virtual void write(FileStorage& fs) const { CV_UNUSED(fs); }
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp:3093:34: error: ‘FileStorage’ was not declared in this scope
3093 | CV_WRAP void write(const Ptr<FileStorage>& fs, const String& name = String()) const;
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp:3093:45: error: template argument 1 is invalid
3093 | CV_WRAP void write(const Ptr<FileStorage>& fs, const String& name = String()) const;
| ^
/usr/include/opencv4/opencv2/core.hpp:3172:22: error: ‘FileStorage’ has not been declared
3172 | void writeFormat(FileStorage& fs) const;
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp: In static member function ‘static cv::Ptr<_Tp> cv::Algorithm::load(const String&, const String&)’:
/usr/include/opencv4/opencv2/core.hpp:3135:9: error: ‘FileStorage’ was not declared in this scope
3135 | FileStorage fs(filename, FileStorage::READ);
| ^~~~~~~~~~~
In file included from /usr/include/opencv4/opencv2/core.hpp:55,
from createsamples.cpp:48:
/usr/include/opencv4/opencv2/core.hpp:3136:19: error: ‘fs’ was not declared in this scope; did you mean ‘ffs’?
3136 | CV_Assert(fs.isOpened());
| ^~
/usr/include/opencv4/opencv2/core/base.hpp:342:38: note: in definition of macro ‘CV_Assert’
342 | #define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
| ^~~~
In file included from createsamples.cpp:48:
/usr/include/opencv4/opencv2/core.hpp:3137:41: error: ‘fs’ was not declared in this scope; did you mean ‘ffs’?
3137 | FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
| ^~
| ffs
/usr/include/opencv4/opencv2/core.hpp:3137:18: error: ‘fn’ has incomplete type
3137 | FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
| ^~
In file included from /usr/include/opencv4/opencv2/core/base.hpp:58,
from /usr/include/opencv4/opencv2/core.hpp:55,
from createsamples.cpp:48:
/usr/include/opencv4/opencv2/core/cvstd.hpp:150:18: note: forward declaration of ‘class cv::FileNode’
150 | class CV_EXPORTS FileNode; //for string constructor from FileNode
| ^~~~~~~~
In file included from createsamples.cpp:48:
/usr/include/opencv4/opencv2/core.hpp: In static member function ‘static cv::Ptr<_Tp> cv::Algorithm::loadFromString(const String&, const String&)’:
/usr/include/opencv4/opencv2/core.hpp:3156:9: error: ‘FileStorage’ was not declared in this scope
3156 | FileStorage fs(strModel, FileStorage::READ + FileStorage::MEMORY);
| ^~~~~~~~~~~
/usr/include/opencv4/opencv2/core.hpp:3157:41: error: ‘fs’ was not declared in this scope; did you mean ‘ffs’?
3157 | FileNode fn = objname.empty() ? fs.getFirstTopLevelNode() : fs[objname];
| ^~
| ffs
Many of the errors are coming from core.hpp and createsample.cpp. createsample.cpp is here: https://github.com/opencv/opencv/blob/master/apps/createsamples/createsamples.cpp
and core.hpp is here: https://github.com/opencv/opencv/blob/master/modules/core/include/opencv2/core.hpp
Would much appreciate any insights on fixing these errors.
Easiest way seems to be downloading an older opencv version source code like https://github.com/opencv/opencv/archive/2.4.13.6.zip and extract it to any location. In that folder perform
mkdir build
cd build
cmake ..
make
cd bin
there you will find the binaries of opencv_createsamples, opencv_traincascade etc.
It is NOT necessary to install that old version (that would happen if you use 'make install' ), just use your currently installed opencv build of any version for all tasks and if you need to create sample or train a cascade, use this build at the directory where you copy it to.

Build errors when trying to integrate external package

I am pretty new to Linux and I am having problems integrating an external software into my program. I am following the instructions on integrating a couple of lines that show step by step integration of the software they are listed in the Application development section here.
I got through some of the instruction [I removed Jansson] and I have separately tested the package independent and build it thus it works outside. The problem is when intergrating after make install command it shows these errors:
Scanning dependencies of target g4sipm_sample
[ 63%] Building CXX object externals/g4sipm/sample/CMakeFiles/g4sipm_sample.dir/src/ActionInitialization.cc.o
/home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc: In member function ‘virtual void ActionInitialization::Build() const’:
/home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc:45:38: error: no matching function for call to ‘RunAction::RunAction(const string&)’
45 | SetUserAction(new RunAction(filename));
| ^
In file included from /home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc:21:
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/RunAction.hh:35:2: note: candidate: ‘RunAction::RunAction(SimulationMessenger*)’
35 | RunAction( SimulationMessenger * simulationMessenger /**< class storing and providing variables which are needed in different parts of the simulation. */
| ^~~~~~~~~
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/RunAction.hh:35:35: note: no known conversion for argument 1 from ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’} to ‘SimulationMessenger*’
35 | RunAction( SimulationMessenger * simulationMessenger /**< class storing and providing variables which are needed in different parts of the simulation. */
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/RunAction.hh:26:7: note: candidate: ‘constexpr RunAction::RunAction(const RunAction&)’
26 | class RunAction : public G4UserRunAction
| ^~~~~~~~~
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/RunAction.hh:26:7: note: no known conversion for argument 1 from ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’} to ‘const RunAction&’
/home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc:46:20: error: no matching function for call to ‘EventAction::EventAction()’
46 | SetUserAction(new EventAction);
| ^~~~~~~~~~~
In file included from /home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc:20:
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/EventAction.hh:38:2: note: candidate: ‘EventAction::EventAction(SimulationMessenger*)’
38 | EventAction( SimulationMessenger * simulationMessenger /**< class storing and providing variables which are needed in different parts of the simulation. */
| ^~~~~~~~~~~
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/EventAction.hh:38:2: note: candidate expects 1 argument, 0 provided
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/EventAction.hh:30:7: note: candidate: ‘constexpr EventAction::EventAction(const EventAction&)’
30 | class EventAction : public G4UserEventAction
| ^~~~~~~~~~~
/home/abhinab1/goddess/source/Simulation/include/DataProcessing/EventAction.hh:30:7: note: candidate expects 1 argument, 0 provided
/home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc:52:57: error: ‘const class DetectorConstruction’ has no member named ‘getSipmModel’
52 | ParticleSourceMessenger::getInstance()->setA(detector->getSipmModel()->getPitch());
| ^~~~~~~~~~~~
/home/abhinab1/goddess/source/externals/g4sipm/sample/src/ActionInitialization.cc:53:57: error: ‘const class DetectorConstruction’ has no member named ‘getSipmModel’
53 | ParticleSourceMessenger::getInstance()->setB(detector->getSipmModel()->getPitch());
Here are the changes that I made in my CMakeFile.txt:
add_subdirectory(externals/g4sipm)
include_directories(externals/g4sipm/g4sipm/include)
include_directories(externals/g4sipm/externals/gtest/include)
# Export sims data
include_directories(externals/g4sipm/sample/include)
set(LIBS ${LIBS} boost_program_options g4sipm g4sipm_sample boost_date_time jansson)
target_link_libraries(RunSimulation g4sipm boost_date_time)
I tried contacting the project lead however it seems they have all moved on from the project. Any help and suggestions would be greatly appreciated, thank you!
EDIT: I made a small mistake as I added
include_directories(externals/g4sipm/sample)
in the Checklist.txt which I removed.
The errors are reduced but not gone I have put the updated terminal output above.

Backward cpp can no longer build, missing lbdf despite linking

I am on arch and made the mistake of upgrading.
Before I could build bacward-cpp, now I get the following error:
../libraries/backward-cpp/backward.hpp:1357:10: error: ‘bfd_get_section_flags’ was not declared in this scope; did you mean ‘bfd_set_section_flags’?
1357 | if ((bfd_get_section_flags(fobj.handle.get(), section) & SEC_ALLOC) == 0)
| ^~~~~~~~~~~~~~~~~~~~~
| bfd_set_section_flags
../libraries/backward-cpp/backward.hpp:1360:24: error: ‘bfd_get_section_vma’ was not declared in this scope; did you mean ‘bfd_set_section_vma’?
1360 | bfd_vma sec_addr = bfd_get_section_vma(fobj.handle.get(), section);
| ^~~~~~~~~~~~~~~~~~~
| bfd_set_section_vma
../libraries/backward-cpp/backward.hpp:1361:26: error: ‘bfd_get_section_size’ was not declared in this scope; did you mean ‘bfd_set_section_size’?
1361 | bfd_size_type size = bfd_get_section_size(section);
| ^~~~~~~~~~~~~~~~~~~~
| bfd_set_section_size
make[1]: *** [VulkanEngine.make:233: obj/Debug/VulkanDebugging.o] Error 1
make: *** [Makefile:30: VulkanEngine] Error 2
I am linking with both lbdf and ldl, by doing -lbfd -ldl as arguments to g++. I am also doing #define BACKWARD_HAS_BFD 1 before including the header as per the documentation.
I am at a loss.
The corresponding macros of binutils changed slightly.
You have to drop the _get from the section macros and remove the fobj.handle.get() parameter manually: bfd_get_section_flags(fobj.handle.get(), section) to bfd_section_flags(section).