Compiling rosbag C++11 APi with just make: error "DSO missing"
File read.cc contains the rosbag C++11, non-boost, API example for reading a rosbag, enclosed inside main(){...}.
Following lines are in file m:
#!/bin/bash
gcc -I/opt/ros/melodic/include read.cc -c -o foo.o
gcc foo.o \
-L/opt/ros/melodic/lib \
-lrosbag \
-lrosbag_storage \
-lrostime \
-o foo.exe
Executing ./m
results in:
$ ./m
/usr/bin/ld: foo.o: undefined reference to symbol '_ZN3ros6HeaderD1Ev'
/opt/ros/melodic/lib/libcpp_common.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
c++filt
shows:
$ c++filt _ZN3ros6HeaderD1Ev
Ros::Header::~Header()
So how can the commands in m
be modified to result in a successful compilation for the C++API example ?