Compiler not finding jpeg and png libraries - c++

I have downloaded and installed this C++ package for plotting and visulisation https://github.com/alandefreitas/matplotplusplus. I have sussessfully linked to it in my CMake file and have no linking errors when including #include <matplot/matplot.h>. However, whenever I use any functions from the library matplot.h I get the following error at compilation.
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_cimg_jpeg_error_exit(jpeg_common_struct*)':
common.cpp:(.text._ZN12cimg_library4CImgIhE21_cimg_jpeg_error_exitEP18jpeg_common_struct[_ZN12cimg_library4CImgIhE21_cimg_jpeg_error_exitEP18jpeg_common_struct]+0x1e): undefined reference to `jpeg_destroy'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_save_jpeg(_IO_FILE*, char const*, unsigned int) const':
common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x12b): undefined reference to `jpeg_std_error'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x152): undefined reference to `jpeg_CreateCompress'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x16d): undefined reference to `jpeg_stdio_dest'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x198): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x1b2): undefined reference to `jpeg_set_quality'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x1c6): undefined reference to `jpeg_start_compress'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x2cf): undefined reference to `jpeg_write_scanlines'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x2ed): undefined reference to `jpeg_finish_compress'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE10_save_jpegEP8_IO_FILEPKcj]+0x302): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_save_png(_IO_FILE*, char const*, unsigned int) const':
common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x2f4): undefined reference to `png_create_write_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x309): undefined reference to `png_create_info_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x32b): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x34f): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x409): undefined reference to `png_init_io'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x474): undefined reference to `png_set_IHDR'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x485): undefined reference to `png_write_info'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0xc36): undefined reference to `png_write_image'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0xc43): undefined reference to `png_write_end'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0xc50): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: common.cpp:(.text._ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj[_ZNK12cimg_library4CImgIhE9_save_pngEP8_IO_FILEPKcj]+0x1830): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::save_cimg(char const*, bool) const':
common.cpp:(.text._ZNK12cimg_library4CImgIhE9save_cimgEPKcb[_ZNK12cimg_library4CImgIhE9save_cimgEPKcb]+0x3bb): undefined reference to `compress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_load_png(_IO_FILE*, char const*, unsigned int*)':
common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x88): undefined reference to `png_sig_cmp'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xa2): undefined reference to `png_create_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xb7): undefined reference to `png_create_info_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xcd): undefined reference to `png_create_info_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0xef): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x14a): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x1c9): undefined reference to `png_init_io'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x1d7): undefined reference to `png_set_sig_bytes'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x1e4): undefined reference to `png_read_info'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x20e): undefined reference to `png_get_IHDR'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x252): undefined reference to `png_get_valid'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x280): undefined reference to `png_set_filler'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x28d): undefined reference to `png_read_update_info'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x2c2): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x369): undefined reference to `png_set_expand_gray_1_2_4_to_8'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x389): undefined reference to `png_set_gray_to_rgb'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x3a9): undefined reference to `png_set_tRNS_to_alpha'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x41f): undefined reference to `png_read_image'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x42c): undefined reference to `png_read_end'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x461): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x4f1): undefined reference to `png_set_palette_to_rgb'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x683): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x84a): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj[_ZN12cimg_library4CImgIhE9_load_pngEP8_IO_FILEPKcPj]+0x9d3): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImgList<unsigned char>::_load_cimg(_IO_FILE*, char const*)':
common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x404): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x70c): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x93b): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0xce5): undefined reference to `uncompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x10f7): undefined reference to `uncompress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o):common.cpp:(.text._ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc[_ZN12cimg_library8CImgListIhE10_load_cimgEP8_IO_FILEPKc]+0x1506): more undefined references to `uncompress' follow
/usr/bin/ld: /usr/local/lib/libmatplot.a(common.cpp.o): in function `cimg_library::CImg<unsigned char>::_load_jpeg(_IO_FILE*, char const*)':
common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x67): undefined reference to `jpeg_std_error'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xb3): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xc5): undefined reference to `jpeg_stdio_src'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xd2): undefined reference to `jpeg_read_header'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0xda): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x1f8): undefined reference to `jpeg_read_scanlines'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x278): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: common.cpp:(.text._ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc[_ZN12cimg_library4CImgIhE10_load_jpegEP8_IO_FILEPKc]+0x284): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: /usr/local/lib/libmatplot.a(network.cpp.o): in function `matplot::network::process_force_layout()':
network.cpp:(.text+0x304e): undefined reference to `nodesoup::size_radiuses(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, double, double)'
/usr/bin/ld: network.cpp:(.text+0x312a): undefined reference to `nodesoup::fruchterman_reingold(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, unsigned int, unsigned int, unsigned int, double, std::function<void (std::vector<nodesoup::Point2D, std::allocator<nodesoup::Point2D> > const&, int)>)'
/usr/bin/ld: /usr/local/lib/libmatplot.a(network.cpp.o): in function `matplot::network::process_kawai_layout()':
network.cpp:(.text+0x3842): undefined reference to `nodesoup::size_radiuses(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, double, double)'
/usr/bin/ld: network.cpp:(.text+0x390c): undefined reference to `nodesoup::kamada_kawai(std::vector<std::vector<unsigned long, std::allocator<unsigned long> >, std::allocator<std::vector<unsigned long, std::allocator<unsigned long> > > > const&, unsigned int, unsigned int, double, double)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/example.dir/build.make:84: example] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/example.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
The errors are plenty, but they are all of the form undefined reference to png_... or undefined reference to jpeg_... except for those that are undefined reference to 'uncompress'. It seems as though CMake is not finding png and jpeg. I definitely do have libjpeg and libpng installed. Why are these errors ocurring? Do I need to add lines to my CMakeLists.txt to find jpeg and png? I am running Ubuntu 20.04, g++ 9.3.0, and cmake 3.16.3.
Here is a very simple example that prodces the error. This is the cmake file
cmake_minimum_required(VERSION 3.10)
project(example)
set(CMAKE_CXX_COMPILER "c++")
find_package(Matplot++)
add_executable(example example.cpp)
target_link_libraries(example PUBLIC matplot)
Here is an example c++ code (pulled directly from the examples on the linked site).
#include <cmath>
#include <matplot/matplot.h>
int main() {
using namespace matplot;
std::vector<double> x = linspace(0, 10, 150);
std::vector<double> y = transform(x, [](auto x) { return cos(5 * x); });
plot(x, y)->color({0, 0.7, 0.9});
title("2-D Line Plot");
xlabel("x");
ylabel("cos(5x)");
show();
return 0;
}

I had the same problem (with Windows MinGW). Thanks to #drescherjm hint (add the option -DBUILD_SHARED_LIBS=ON), these are the steps I used to solve the problem:
git clone http://github.com/alandefreitas/matplotplusplus
cd matplotplusplus/
mkdir compil-release && cd compil-release
rm CMakeCache.txt # if already exists
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="${YOUR_LIB_PATH}/matplot1.0.1"
make -j4 && make install
Then, and I guess that is a bug, I had to manually copy the .dll to the install path
cp source/matplot/libmatplot.dll ${YOUR_LIB_PATH}/matplot1.0.1/lib/
Hope this works for you.

Related

grpc core undefined references for c++ grpc v1.50?

I built gRPC from source with cmake.
I then build my client which is gRPC based with cmake.
As far as I understand the linking error I get is not related to my source code but perhaps a configuration issue. The weirder thing is that the libraries the linker complains about should be a part of the libgrpc++.a(based on gRPC cmake.)
the failed command
/usr/bin/c++ -Werror -g xxxx/my/client/CMakeFiles/my_client.dir/my_client.cc.o \
-o /tmp/my_client -W xxxx/my/proto/libmy_core.a /usr/local/lib/libgrpc++_reflection.a \
/usr/local/lib/libgrpc++.a /usr/local/lib/libprotobuf.a
error log
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::set_call(grpc_call*, std::shared_ptr<grpc::Channel> const&)':
client_context.cc:(.text+0x213): undefined reference to `absl::lts_20220623::Mutex::Lock()'
/usr/bin/ld: client_context.cc:(.text+0x2e0): undefined reference to `grpc_call_cancel'
/usr/bin/ld: client_context.cc:(.text+0x2e8): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: client_context.cc:(.text+0x31a): undefined reference to `grpc_call_cancel_with_status'
/usr/bin/ld: client_context.cc:(.text+0x382): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::TryCancel()':
client_context.cc:(.text+0x3f3): undefined reference to `absl::lts_20220623::Mutex::Lock()'
/usr/bin/ld: client_context.cc:(.text+0x40d): undefined reference to `grpc_call_cancel'
/usr/bin/ld: client_context.cc:(.text+0x415): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: client_context.cc:(.text+0x428): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::peer[abi:cxx11]() const':
client_context.cc:(.text+0x468): undefined reference to `grpc_call_get_peer'
/usr/bin/ld: client_context.cc:(.text+0x490): undefined reference to `gpr_free'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::SetGlobalCallbacks(grpc::ClientContext::GlobalCallbacks*)':
client_context.cc:(.text+0x502): undefined reference to `gpr_log'
/usr/bin/ld: client_context.cc:(.text+0x532): undefined reference to `gpr_log'
/usr/bin/ld: client_context.cc:(.text+0x562): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::ClientContext()':
client_context.cc:(.text+0x5b0): undefined reference to `gpr_inf_future'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::~ClientContext()':
client_context.cc:(.text+0x8ab): undefined reference to `grpc_call_unref'
/usr/bin/ld: client_context.cc:(.text+0xaa7): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::set_compression_algorithm(grpc_compression_algorithm)':
client_context.cc:(.text+0xf1b): undefined reference to `grpc_compression_algorithm_name'
/usr/bin/ld: client_context.cc:(.text+0x10c2): undefined reference to `gpr_log'
/usr/bin/ld: client_context.cc:(.text+0x10ec): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::set_credentials(std::shared_ptr<grpc::CallCredentials> const&)':
client_context.cc:(.text+0x165): undefined reference to `grpc_call_cancel_with_status'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::internal::GrpcLibrary::shutdown()':
client_context.cc:(.text._ZN4grpc8internal11GrpcLibrary8shutdownEv[_ZN4grpc8internal11GrpcLibrary8shutdownEv]+0x5): undefined reference to `grpc_shutdown'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::internal::GrpcLibrary::init()':
client_context.cc:(.text._ZN4grpc8internal11GrpcLibrary4initEv[_ZN4grpc8internal11GrpcLibrary4initEv]+0x5): undefined reference to `grpc_init'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::set_call(grpc_call*, std::shared_ptr<grpc::Channel> const&) [clone .cold]':
client_context.cc:(.text.unlikely+0x9): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::TryCancel() [clone .cold]':
client_context.cc:(.text.unlikely+0x1a): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_context.cc.o): in function `grpc::ClientContext::ClientContext() [clone .cold]':
client_context.cc:(.text.unlikely+0xcf): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(create_channel.cc.o): in function `grpc::CreateCustomChannel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc::ChannelCredentials> const&, grpc::ChannelArguments const&)':
create_channel.cc:(.text+0xa9): undefined reference to `grpc_lame_client_channel_create'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(create_channel.cc.o): in function `grpc::experimental::CreateCustomChannelWithInterceptors(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<grpc::ChannelCredentials> const&, grpc::ChannelArguments const&, std::vector<std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface, std::default_delete<grpc::experimental::ClientInterceptorFactoryInterface> >, std::allocator<std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface, std::default_delete<grpc::experimental::ClientInterceptorFactoryInterface> > > >)':
create_channel.cc:(.text+0x330): undefined reference to `grpc_lame_client_channel_create'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(insecure_credentials.cc.o): in function `grpc::(anonymous namespace)::InsecureChannelCredentialsImpl::CreateChannelWithInterceptors(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, grpc::ChannelArguments const&, std::vector<std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface, std::default_delete<grpc::experimental::ClientInterceptorFactoryInterface> >, std::allocator<std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface, std::default_delete<grpc::experimental::ClientInterceptorFactoryInterface> > > >)':
insecure_credentials.cc:(.text+0x1b8): undefined reference to `grpc_insecure_credentials_create'
/usr/bin/ld: insecure_credentials.cc:(.text+0x1ec): undefined reference to `grpc_channel_create'
/usr/bin/ld: insecure_credentials.cc:(.text+0x26e): undefined reference to `grpc_channel_credentials_release'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(insecure_credentials.cc.o): in function `grpc::(anonymous namespace)::InsecureChannelCredentialsImpl::CreateChannelImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, grpc::ChannelArguments const&)':
insecure_credentials.cc:(.text+0x327): undefined reference to `grpc_insecure_credentials_create'
/usr/bin/ld: insecure_credentials.cc:(.text+0x35f): undefined reference to `grpc_channel_create'
/usr/bin/ld: insecure_credentials.cc:(.text+0x3ea): undefined reference to `grpc_channel_credentials_release'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::~ChannelArguments()':
channel_arguments.cc:(.text+0xc4): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text+0xe6): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text+0x109): undefined reference to `vtable for grpc_core::ScopedTimeCache'
/usr/bin/ld: channel_arguments.cc:(.text+0x124): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text+0x13b): undefined reference to `grpc_core::Fork::support_enabled_'
/usr/bin/ld: channel_arguments.cc:(.text+0x158): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text+0x191): undefined reference to `grpc_core::ExecCtx::Flush()'
/usr/bin/ld: channel_arguments.cc:(.text+0x1a8): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text+0x1e0): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text+0x28b): undefined reference to `grpc_core::Fork::support_enabled_'
/usr/bin/ld: channel_arguments.cc:(.text+0x29b): undefined reference to `grpc_core::Fork::DoDecExecCtxCount()'
/usr/bin/ld: channel_arguments.cc:(.text+0x2a9): undefined reference to `grpc_core::Fork::DoIncExecCtxCount()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::SetSocketMutator(grpc_socket_mutator*)':
channel_arguments.cc:(.text+0x384): undefined reference to `grpc_socket_mutator_to_arg(grpc_socket_mutator*)'
/usr/bin/ld: channel_arguments.cc:(.text+0x408): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text+0x432): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text+0x454): undefined reference to `vtable for grpc_core::ScopedTimeCache'
/usr/bin/ld: channel_arguments.cc:(.text+0x477): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text+0x491): undefined reference to `grpc_core::Fork::support_enabled_'
/usr/bin/ld: channel_arguments.cc:(.text+0x4b3): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text+0x666): undefined reference to `grpc_core::ExecCtx::Flush()'
/usr/bin/ld: channel_arguments.cc:(.text+0x685): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text+0x6c8): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text+0x842): undefined reference to `gpr_log'
/usr/bin/ld: channel_arguments.cc:(.text+0x983): undefined reference to `grpc_core::Fork::support_enabled_'
/usr/bin/ld: channel_arguments.cc:(.text+0x993): undefined reference to `grpc_core::Fork::DoDecExecCtxCount()'
/usr/bin/ld: channel_arguments.cc:(.text+0x9a1): undefined reference to `grpc_core::Fork::DoIncExecCtxCount()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::ChannelArguments(grpc::ChannelArguments const&)':
channel_arguments.cc:(.text+0xd62): undefined reference to `gpr_log'
/usr/bin/ld: channel_arguments.cc:(.text+0xe02): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::SetUserAgentPrefix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
channel_arguments.cc:(.text+0x1c17): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::SetResourceQuota(grpc::ResourceQuota const&)':
channel_arguments.cc:(.text+0x1ffc): undefined reference to `grpc_resource_quota_arg_vtable'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc_core::ExecCtx::~ExecCtx()':
channel_arguments.cc:(.text._ZN9grpc_core7ExecCtxD2Ev[_ZN9grpc_core7ExecCtxD5Ev]+0x21): undefined reference to `grpc_core::ExecCtx::Flush()'
/usr/bin/ld: channel_arguments.cc:(.text._ZN9grpc_core7ExecCtxD2Ev[_ZN9grpc_core7ExecCtxD5Ev]+0x3c): undefined reference to `grpc_core::ExecCtx::exec_ctx_'
/usr/bin/ld: channel_arguments.cc:(.text._ZN9grpc_core7ExecCtxD2Ev[_ZN9grpc_core7ExecCtxD5Ev]+0x73): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: channel_arguments.cc:(.text._ZN9grpc_core7ExecCtxD2Ev[_ZN9grpc_core7ExecCtxD5Ev]+0x93): undefined reference to `grpc_core::Fork::support_enabled_'
/usr/bin/ld: channel_arguments.cc:(.text._ZN9grpc_core7ExecCtxD2Ev[_ZN9grpc_core7ExecCtxD5Ev]+0x9f): undefined reference to `grpc_core::Fork::DoDecExecCtxCount()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::~ChannelArguments() [clone .cold]':
channel_arguments.cc:(.text.unlikely+0x1e): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_arguments.cc.o): in function `grpc::ChannelArguments::SetSocketMutator(grpc_socket_mutator*) [clone .cold]':
channel_arguments.cc:(.text.unlikely+0x9b): undefined reference to `grpc_core::Timestamp::thread_local_time_source_'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::~Channel()':
channel_cc.cc:(.text+0x18a): undefined reference to `grpc_channel_destroy'
/usr/bin/ld: channel_cc.cc:(.text+0x1de): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: channel_cc.cc:(.text+0x271): undefined reference to `grpc_iomgr_run_in_background()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::CallbackCQ()':
channel_cc.cc:(.text+0x393): undefined reference to `absl::lts_20220623::Mutex::Lock()'
/usr/bin/ld: channel_cc.cc:(.text+0x3a5): undefined reference to `grpc_iomgr_run_in_background()'
/usr/bin/ld: channel_cc.cc:(.text+0x497): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: channel_cc.cc:(.text+0x4b0): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::WaitForStateChangeImpl(grpc_connectivity_state, gpr_timespec)':
channel_cc.cc:(.text+0x69b): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: channel_cc.cc:(.text+0x6f2): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::GetLoadBalancingPolicyName[abi:cxx11]() const':
channel_cc.cc:(.text+0x906): undefined reference to `grpc_channel_get_info'
/usr/bin/ld: channel_cc.cc:(.text+0x963): undefined reference to `gpr_free'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::GetServiceConfigJSON[abi:cxx11]() const':
channel_cc.cc:(.text+0xaa6): undefined reference to `grpc_channel_get_info'
/usr/bin/ld: channel_cc.cc:(.text+0xb03): undefined reference to `gpr_free'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::CreateCallInternal(grpc::internal::RpcMethod const&, grpc::ClientContext*, grpc::CompletionQueue*, unsigned long)':
channel_cc.cc:(.text+0xcf5): undefined reference to `grpc_channel_create_registered_call'
/usr/bin/ld: channel_cc.cc:(.text+0xdc7): undefined reference to `grpc_channel_create_call'
/usr/bin/ld: channel_cc.cc:(.text+0xde3): undefined reference to `grpc_slice_unref'
/usr/bin/ld: channel_cc.cc:(.text+0xdfc): undefined reference to `grpc_slice_unref'
/usr/bin/ld: channel_cc.cc:(.text+0xe16): undefined reference to `grpc_census_call_set_context'
/usr/bin/ld: channel_cc.cc:(.text+0x10e6): undefined reference to `grpc_channel_create_call'
/usr/bin/ld: channel_cc.cc:(.text+0x1102): undefined reference to `grpc_slice_unref'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::RegisterMethod(char const*)':
channel_cc.cc:(.text+0xa8): undefined reference to `grpc_channel_register_call'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::GetState(bool)':
channel_cc.cc:(.text+0xbd): undefined reference to `grpc_channel_check_connectivity_state'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::NotifyOnStateChangeImpl(grpc_connectivity_state, gpr_timespec, grpc::CompletionQueue*, void*)':
channel_cc.cc:(.text+0x12d): undefined reference to `grpc_channel_watch_connectivity_state'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::experimental::ChannelResetConnectionBackoff(grpc::Channel*)':
channel_cc.cc:(.text+0xc09): undefined reference to `grpc_channel_reset_connect_backoff'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::CallbackCQ() [clone .cold]':
channel_cc.cc:(.text.unlikely+0x12): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: channel_cc.cc:(.text.unlikely+0x2f): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(channel_cc.cc.o): in function `grpc::Channel::WaitForStateChangeImpl(grpc_connectivity_state, gpr_timespec) [clone .cold]':
channel_cc.cc:(.text.unlikely+0x75): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::(anonymous namespace)::CallbackAlternativeCQ::Ref()::{lambda(void*)#1}::_FUN(void*)':
completion_queue_cc.cc:(.text+0x4b): undefined reference to `gpr_time_from_millis'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x5b): undefined reference to `gpr_now'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x6c): undefined reference to `gpr_time_add'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x79): undefined reference to `grpc_completion_queue_next'
/usr/bin/ld: completion_queue_cc.cc:(.text+0xab): undefined reference to `gpr_time_from_millis'
/usr/bin/ld: completion_queue_cc.cc:(.text+0xbb): undefined reference to `gpr_now'
/usr/bin/ld: completion_queue_cc.cc:(.text+0xcc): undefined reference to `gpr_time_add'
/usr/bin/ld: completion_queue_cc.cc:(.text+0xd7): undefined reference to `gpr_sleep_until'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec)':
completion_queue_cc.cc:(.text+0x198): undefined reference to `grpc_completion_queue_next'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::CompletionQueueTLSCache::~CompletionQueueTLSCache()':
completion_queue_cc.cc:(.text+0x256): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::CompletionQueueTLSCache::Flush(void**, bool*)':
completion_queue_cc.cc:(.text+0x29f): undefined reference to `grpc_completion_queue_thread_local_cache_flush'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::CallbackAlternativeCQ()':
completion_queue_cc.cc:(.text+0x321): undefined reference to `gpr_once_init'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x330): undefined reference to `absl::lts_20220623::Mutex::Lock()'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x353): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x426): undefined reference to `gpr_cpu_num_cores'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x4b2): undefined reference to `grpc_core::Thread::Thread(char const*, void (*)(void*), void*, bool*, grpc_core::Thread::Options const&)'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x570): undefined reference to `grpc_core::Thread::Thread(char const*, void (*)(void*), void*, bool*, grpc_core::Thread::Options const&)'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x684): undefined reference to `gpr_log'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x712): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::ReleaseCallbackAlternativeCQ(grpc::CompletionQueue*)':
completion_queue_cc.cc:(.text+0x7a9): undefined reference to `absl::lts_20220623::Mutex::Lock()'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x80b): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: completion_queue_cc.cc:(.text+0x87c): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::CompletionQueueTLSCache::CompletionQueueTLSCache(grpc::CompletionQueue*)':
completion_queue_cc.cc:(.text+0x210): undefined reference to `grpc_completion_queue_thread_local_cache_init'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc_core::Thread::~Thread()':
completion_queue_cc.cc:(.text._ZN9grpc_core6ThreadD2Ev[_ZN9grpc_core6ThreadD5Ev]+0x3d): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::CallbackAlternativeCQ() [clone .cold]':
completion_queue_cc.cc:(.text.unlikely+0x11): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: completion_queue_cc.cc:(.text.unlikely+0x2b): undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(completion_queue_cc.cc.o): in function `grpc::CompletionQueue::ReleaseCallbackAlternativeCQ(grpc::CompletionQueue*) [clone .cold]':
completion_queue_cc.cc:(.text.unlikely+0x83): undefined reference to `absl::lts_20220623::Mutex::Unlock()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(client_interceptor.cc.o): in function `grpc::experimental::RegisterGlobalClientInterceptorFactory(grpc::experimental::ClientInterceptorFactoryInterface*)':
client_interceptor.cc:(.text+0x38): undefined reference to `gpr_log'
/usr/bin/ld: xxxx/my/proto/libmy_core.a(my.grpc.pb.cc.o): in function `grpc::CompletionQueue::~CompletionQueue()':
/usr/local/include/grpcpp/impl/codegen/completion_queue.h:119: undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: xxxx/my/proto/libmy_core.a(my.grpc.pb.cc.o): in function `grpc::CompletionQueue::CompletionQueue(grpc_completion_queue_attributes const&)':
/usr/local/include/grpcpp/impl/codegen/completion_queue.h:253: undefined reference to `absl::lts_20220623::Mutex::~Mutex()'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_new_with_user_data(void*, unsigned long, void (*)(void*), void*)':
core_codegen.cc:(.text+0x2ca): undefined reference to `grpc_slice_new_with_user_data'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_new_with_len(void*, unsigned long, void (*)(void*, unsigned long))':
core_codegen.cc:(.text+0x317): undefined reference to `grpc_slice_new_with_len'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_empty_slice()':
core_codegen.cc:(.text+0x35e): undefined reference to `grpc_empty_slice'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_malloc(unsigned long)':
core_codegen.cc:(.text+0x3b1): undefined reference to `grpc_slice_malloc'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_ref(grpc_slice)':
core_codegen.cc:(.text+0x41e): undefined reference to `grpc_slice_ref'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_split_tail(grpc_slice*, unsigned long)':
core_codegen.cc:(.text+0x474): undefined reference to `grpc_slice_split_tail'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_split_head(grpc_slice*, unsigned long)':
core_codegen.cc:(.text+0x4c4): undefined reference to `grpc_slice_split_head'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_sub(grpc_slice, unsigned long, unsigned long)':
core_codegen.cc:(.text+0x524): undefined reference to `grpc_slice_sub'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_from_static_buffer(void const*, unsigned long)':
core_codegen.cc:(.text+0x574): undefined reference to `grpc_slice_from_static_buffer'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_slice_from_copied_buffer(void const*, unsigned long)':
core_codegen.cc:(.text+0x5c4): undefined reference to `grpc_slice_from_copied_buffer'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::assert_fail(char const*, char const*, int)':
core_codegen.cc:(.text+0x67f): undefined reference to `gpr_log'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_factory_lookup(grpc_completion_queue_attributes const*)':
core_codegen.cc:(.text+0x28): undefined reference to `grpc_completion_queue_factory_lookup'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_create(grpc_completion_queue_factory const*, grpc_completion_queue_attributes const*, void*)':
core_codegen.cc:(.text+0x3e): undefined reference to `grpc_completion_queue_create'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_create_for_next(void*)':
core_codegen.cc:(.text+0x58): undefined reference to `grpc_completion_queue_create_for_next'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_create_for_pluck(void*)':
core_codegen.cc:(.text+0x68): undefined reference to `grpc_completion_queue_create_for_pluck'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_shutdown(grpc_completion_queue*)':
core_codegen.cc:(.text+0x78): undefined reference to `grpc_completion_queue_shutdown'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_destroy(grpc_completion_queue*)':
core_codegen.cc:(.text+0x88): undefined reference to `grpc_completion_queue_destroy'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_completion_queue_pluck(grpc_completion_queue*, void*, gpr_timespec, void*)':
core_codegen.cc:(.text+0xa4): undefined reference to `grpc_completion_queue_pluck'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_malloc(unsigned long)':
core_codegen.cc:(.text+0xb8): undefined reference to `gpr_malloc'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_free(void*)':
core_codegen.cc:(.text+0xc8): undefined reference to `gpr_free'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_init()':
core_codegen.cc:(.text+0xd5): undefined reference to `grpc_init'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::grpc_shutdown()':
core_codegen.cc:(.text+0xe5): undefined reference to `grpc_shutdown'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_mu_init(long*)':
core_codegen.cc:(.text+0xf8): undefined reference to `gpr_mu_init'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_mu_destroy(long*)':
core_codegen.cc:(.text+0x108): undefined reference to `gpr_mu_destroy'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_mu_lock(long*)':
core_codegen.cc:(.text+0x118): undefined reference to `gpr_mu_lock'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_mu_unlock(long*)':
core_codegen.cc:(.text+0x128): undefined reference to `gpr_mu_unlock'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function `grpc::CoreCodegen::gpr_cv_init(long*)':
core_codegen.cc:(.text+0x138): undefined reference to `gpr_cv_init'
/usr/bin/ld: /usr/local/lib/libgrpc++.a(core_codegen.cc.o): in function
# there are more logs, but not enough space for SO question
For those who may run into the same issue, there is a conversation about this at https://github.com/grpc/grpc/issues/31449.

How to fix multiple definition of main building gtest project using make on ubuntu [duplicate]

This question already has an answer here:
Linking issue with GCC 4.6.1
(1 answer)
Closed 1 year ago.
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
angus#angus-VirtualBox:~/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 x86_64 GNU/Linux
I installed gtest like this:
git clone https://github.com/google/googletest.git
mkdir build
cd build
sudo snap install cmake --classic
cmake .. -DBUILD_GMOCK=OFF
make
sudo make install
If I now look on my system I have
/usr/local/include - with gtest directory with header files
/usr/local/lib - contains libgtest.a and libgtest_main.a
I modified the Makefile in the example to be like this:
CXX = g++
CXXFLAGS = -g -L/usr/local/lib -lgtest -lgtest_main -lpthread
INCS = -I./ -I../../src -I/usr/local/include
OBJS = ../../src/Addition.o Addition_Test.o ../../src/Multiply.o Multiply_Test.o
testAll: $(OBJS)
$(CXX) $(CXXFLAGS) $(INCS) -o testAll Main_TestAll.cpp $(OBJS)
.cpp.o:
$(CXX) $(CXXFLAGS) -c $< -o $# $(INCS)
clean:
rm testAll *.o testAll.xml
I also had to tidy up the code sample - eg where in code has Addition.h - have to change to Addition.hpp which is the filename.
The build error below. How to fix this?
I did try by removing -lgtest_main from the Makefile, but then get error:
/home/angus/Documents/code/gtest_make_only/test/src/Main_TestAll.cpp:5: undefined reference to `testing::InitGoogleTest(int*, char**)'
build error:
angus#angus-VirtualBox:~/Documents/code/gtest_make_only/test/src$ make
g++ -g -L/usr/local/lib -lgtest -lgtest_main -lpthread -c Multiply_Test.cpp -o Multiply_Test.o -I./ -I../../src -I/usr/local/include
g++ -g -L/usr/local/lib -lgtest -lgtest_main -lpthread -I./ -I../../src -I/usr/local/include -o testAll Main_TestAll.cpp ../../src/Addition.o Addition_Test.o ../../src/Multiply.o Multiply_Test.o
/usr/bin/ld: /tmp/cc4xkhF1.o: in function `RUN_ALL_TESTS()':
/home/angus/Documents/code/gtest_make_only/test/src/Main_TestAll.cpp:4: multiple definition of `main'; /usr/local/lib/libgtest_main.a(gtest_main.cc.o):gtest_main.cc:(.text+0x0): first defined here
/usr/bin/ld: /usr/local/lib/libgtest_main.a(gtest_main.cc.o): in function `main':
gtest_main.cc:(.text+0x3a): undefined reference to `testing::InitGoogleTest(int*, char**)'
/usr/bin/ld: /usr/local/lib/libgtest_main.a(gtest_main.cc.o): in function `RUN_ALL_TESTS()':
gtest_main.cc:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0x9): undefined reference to `testing::UnitTest::GetInstance()'
/usr/bin/ld: gtest_main.cc:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0x11): undefined reference to `testing::UnitTest::Run()'
/usr/bin/ld: /tmp/cc4xkhF1.o: in function `main':
/home/angus/Documents/code/gtest_make_only/test/src/Main_TestAll.cpp:5: undefined reference to `testing::InitGoogleTest(int*, char**)'
/usr/bin/ld: Addition_Test.o: in function `AdditionTest_twoValues_Test::TestBody()':
/home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:20: undefined reference to `testing::Message::Message()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:20: undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:20: undefined reference to `testing::internal::AssertHelper::operator=(testing::Message const&) const'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:20: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:21: undefined reference to `testing::Message::Message()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:21: undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:21: undefined reference to `testing::internal::AssertHelper::operator=(testing::Message const&) const'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:21: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:20: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:21: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: Addition_Test.o: in function `__static_initialization_and_destruction_0(int, int)':
/home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:16: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/usr/bin/ld: Addition_Test.o: in function `testing::internal::SuiteApiResolver<AdditionTest>::GetSetUpCaseOrSuite(char const*, int)':
/usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::IsTrue(bool)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::GTestLog::GTestLog(testing::internal::GTestLogSeverity, char const*, int)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: Addition_Test.o: in function `testing::internal::SuiteApiResolver<AdditionTest>::GetTearDownCaseOrSuite(char const*, int)':
/usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::IsTrue(bool)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::GTestLog::GTestLog(testing::internal::GTestLogSeverity, char const*, int)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: Addition_Test.o: in function `testing::AssertionResult testing::internal::CmpHelperEQ<int, int>(char const*, char const*, int const&, int const&)':
/usr/local/include/gtest/gtest.h:1549: undefined reference to `testing::AssertionSuccess()'
/usr/bin/ld: Addition_Test.o: in function `testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&)':
/usr/local/include/gtest/gtest.h:1532: undefined reference to `testing::internal::EqFailure(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/usr/bin/ld: Addition_Test.o: in function `AdditionTest::~AdditionTest()':
/home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:5: undefined reference to `testing::Test::~Test()'
/usr/bin/ld: Addition_Test.o:(.data.rel.ro._ZTI12AdditionTest[_ZTI12AdditionTest]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: Addition_Test.o: in function `AdditionTest::AdditionTest()':
/home/angus/Documents/code/gtest_make_only/test/src/Addition_Test.cpp:5: undefined reference to `testing::Test::Test()'
/usr/bin/ld: Multiply_Test.o: in function `MultiplyTest_twoValues_Test::TestBody()':
/home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:18: undefined reference to `testing::Message::Message()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:18: undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:18: undefined reference to `testing::internal::AssertHelper::operator=(testing::Message const&) const'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:18: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:19: undefined reference to `testing::Message::Message()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:19: undefined reference to `testing::internal::AssertHelper::AssertHelper(testing::TestPartResult::Type, char const*, int, char const*)'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:19: undefined reference to `testing::internal::AssertHelper::operator=(testing::Message const&) const'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:19: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:18: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: /home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:19: undefined reference to `testing::internal::AssertHelper::~AssertHelper()'
/usr/bin/ld: Multiply_Test.o: in function `__static_initialization_and_destruction_0(int, int)':
/home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:14: undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/usr/bin/ld: Multiply_Test.o: in function `testing::internal::SuiteApiResolver<MultiplyTest>::GetSetUpCaseOrSuite(char const*, int)':
/usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::IsTrue(bool)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::GTestLog::GTestLog(testing::internal::GTestLogSeverity, char const*, int)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:527: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: Multiply_Test.o: in function `testing::internal::SuiteApiResolver<MultiplyTest>::GetTearDownCaseOrSuite(char const*, int)':
/usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::IsTrue(bool)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::GTestLog::GTestLog(testing::internal::GTestLogSeverity, char const*, int)'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: /usr/local/include/gtest/internal/gtest-internal.h:548: undefined reference to `testing::internal::GTestLog::~GTestLog()'
/usr/bin/ld: Multiply_Test.o: in function `MultiplyTest::~MultiplyTest()':
/home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:5: undefined reference to `testing::Test::~Test()'
/usr/bin/ld: Multiply_Test.o:(.data.rel.ro._ZTI12MultiplyTest[_ZTI12MultiplyTest]+0x10): undefined reference to `typeinfo for testing::Test'
/usr/bin/ld: Multiply_Test.o: in function `MultiplyTest::MultiplyTest()':
/home/angus/Documents/code/gtest_make_only/test/src/Multiply_Test.cpp:5: undefined reference to `testing::Test::Test()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: testAll] Error 1
Your command lines are all wrong.
Library specification should follow sources and object files. Correct line should look like this:
g++ -g -I./ -I../../src -o testAll Main_TestAll.cpp ../../src/Addition.o Addition_Test.o ../../src/Multiply.o Multiply_Test.o -lgtest_main -lgtest -lpthread
See this blog post for explanation.

makefile example to use soplex

I'm trying to link soplex (the infinite precision LP solver of SCIP) in my C/C++ code. I managed to install soplex in my linux machine and from the command line it works.
My problem is that I do not manage to link it in my code:
I'm currently using a normal makefile in which I've put:
#sopleX HERE
SOPLEX_DIR = /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib
SOPLEX_INCLUDE= /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/src
LP_LIBS = -L/usr/lib/x86_64-linux-gnu/ -lgmp -L$(CPLEXLIBDIR) -lilocplex -lcplex -lm -lpthread -ldl -frounding-math -L$(GRBLIBDIR) -lgurobi90 -L$(SOPLEX_DIR) -lsoplex
DBG= -O3 -DIL_STD
INCDIR = -I. -I$(LP_INCLUDE) -I/usr/local/include -I$(GRB_LP_INCLUDE) -I$(SOPLEX_INCLUDE)
CXXFLAGS = $(DBG) $(INCDIR)
.c.o:
gcc -c $(CXXFLAGS) $< -o $#
#LDLIBS = $(CONCORDE_LIBS) $(MY_LIBS) $(LP_LIBS)
#LDLIBS = $(CONCORDE_LIBS) $(LP_LIBS)
LDLIBS = $(LP_LIBS)
all:BPPS
BPPS: $(OBJS)
$(CXX) $(CXXFLAGS) -o $# $(OBJS) $(LDLIBS)
$(OBJS): Makefile
clean:
rm -f $(OBJS) rm BPPS
but when I try to compile it gives me a series of errors:
g++ -O3 -DIL_STD -I. -I/home/fabio/ILOG/CPLEX_Studio_AcademicResearch129/cplex/include/ilcplex -I/usr/local/include -I/home/fabio/GUROBI/gurobi903/linux64/include -I/home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/src -o BPPS src/Main.o src/DP.o src/DP_LEX.o src/BPPS_BP_MASTER.o src/BPPS_BP_PRICER.o src/BPPS_BP_TREE.o src/BPPS_BP_TRIPLETS.o src/BPPS_BP_DIVING.o src/BPPS_BP_LP_HEUR.o src/BPPS_BP_SP_HEUR.o src/BPPS_BP_MAPPING.o src/REDUCTIONS.o src/preprocessing.o src/global_functions.o source/errors.o source/dp_master.o source/heap.o source/mckpsc-ls.o source/sort.o source/tools.o src/BPPS_FORM_B.o src/BPPS_FORM_A.o -L/usr/lib/x86_64-linux-gnu/ -lgmp -L/home/fabio/ILOG/CPLEX_Studio_AcademicResearch129/cplex/lib/x86-64_linux/static_pic -lilocplex -lcplex -lm -lpthread -ldl -frounding-math -L/home/fabio/GUROBI/gurobi903/linux64/lib -lgurobi90 -L/home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib -lsoplex
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::~Rational()':
rational.cpp:(.text+0x44): undefined reference to `__gmpq_clear'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::freeListMem()':
rational.cpp:(.text+0x138): undefined reference to `__gmpq_clear'
/usr/bin/ld: rational.cpp:(.text+0x157): undefined reference to `__gmpq_clear'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::disableListMem()':
rational.cpp:(.text+0x1f8): undefined reference to `__gmpq_clear'
/usr/bin/ld: rational.cpp:(.text+0x217): undefined reference to `__gmpq_clear'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator=(soplex::Rational const&)':
rational.cpp:(.text+0x2a0): undefined reference to `__gmpq_set'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator=(long double const&)':
rational.cpp:(.text+0x2ec): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x30c): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x32c): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x34b): undefined reference to `__gmpq_set_d'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator=(double const&)':
rational.cpp:(.text+0x398): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x3b2): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x3ca): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x3d9): undefined reference to `__gmpq_set_d'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator=(int const&)':
rational.cpp:(.text+0x413): undefined reference to `__gmpq_set_si'
/usr/bin/ld: rational.cpp:(.text+0x428): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x440): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x458): undefined reference to `__gmpq_set'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator=(__mpq_struct const (&) [1])':
rational.cpp:(.text+0x47d): undefined reference to `__gmpq_set'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator double() const':
rational.cpp:(.text+0x4aa): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x4bd): undefined reference to `__gmpq_equal'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator long double() const':
rational.cpp:(.text+0x51e): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x531): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x53d): undefined reference to `__gmpq_get_d'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator float() const':
rational.cpp:(.text+0x59e): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x5b9): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x5cd): undefined reference to `__gmpq_get_d'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator+=(soplex::Rational const&)':
rational.cpp:(.text+0x641): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x654): undefined reference to `__gmpq_add'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator-=(soplex::Rational const&)':
rational.cpp:(.text+0x681): undefined reference to `__gmpq_sub'
/usr/bin/ld: rational.cpp:(.text+0x694): undefined reference to `__gmpq_set'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator*=(soplex::Rational const&)':
rational.cpp:(.text+0x6e2): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x6f1): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x707): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x716): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x72a): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x753): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x76f): undefined reference to `__gmpq_set'
/usr/bin/ld: rational.cpp:(.text+0x782): undefined reference to `__gmpq_mul'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::operator/=(soplex::Rational const&)':
rational.cpp:(.text+0x7c0): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x7d6): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x7e5): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x7f4): undefined reference to `__gmpq_equal'
/usr/bin/ld: rational.cpp:(.text+0x806): undefined reference to `__gmpq_div'
/usr/bin/ld: rational.cpp:(.text+0x827): undefined reference to `__gmpq_inv'
/usr/bin/ld: rational.cpp:(.text+0x84f): undefined reference to `__gmpq_inv'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::invert()':
rational.cpp:(.text+0x870): undefined reference to `__gmpq_inv'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::powRound()':
rational.cpp:(.text+0x8a5): undefined reference to `__gmpz_init'
/usr/bin/ld: rational.cpp:(.text+0x8b5): undefined reference to `__gmpz_cdiv_q'
/usr/bin/ld: rational.cpp:(.text+0x8c5): undefined reference to `__gmpz_sub_ui'
/usr/bin/ld: rational.cpp:(.text+0x8d2): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rational.cpp:(.text+0x8e2): undefined reference to `__gmpz_ui_pow_ui'
/usr/bin/ld: rational.cpp:(.text+0x8ee): undefined reference to `__gmpq_set_z'
/usr/bin/ld: rational.cpp:(.text+0x8f6): undefined reference to `__gmpz_clear'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::isAdjacentTo(double const&) const':
rational.cpp:(.text+0x94b): undefined reference to `__gmpq_get_d'
/usr/bin/ld: rational.cpp:(.text+0x959): undefined reference to `__gmpq_init'
/usr/bin/ld: rational.cpp:(.text+0x96b): undefined reference to `__gmpq_set_d'
/usr/bin/ld: rational.cpp:(.text+0x976): undefined reference to `__gmpq_cmp'
/usr/bin/ld: rational.cpp:(.text+0x980): undefined reference to `__gmpq_clear'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::Rational::sizeInBase(int) const':
rational.cpp:(.text+0xa92): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rational.cpp:(.text+0xaa1): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::readStringRational(char const*, soplex::Rational&)':
rational.cpp:(.text+0xb2e): undefined reference to `__gmpq_set_str'
/usr/bin/ld: rational.cpp:(.text+0xb6d): undefined reference to `__gmpq_canonicalize'
/usr/bin/ld: rational.cpp:(.text+0xba2): undefined reference to `__gmpz_init'
/usr/bin/ld: rational.cpp:(.text+0xbaa): undefined reference to `__gmpq_init'
/usr/bin/ld: rational.cpp:(.text+0xc99): undefined reference to `__gmpq_set_str'
/usr/bin/ld: rational.cpp:(.text+0xcaa): undefined reference to `__gmpq_canonicalize'
/usr/bin/ld: rational.cpp:(.text+0xcd8): undefined reference to `__gmpq_canonicalize'
/usr/bin/ld: rational.cpp:(.text+0xce0): undefined reference to `__gmpz_clear'
/usr/bin/ld: rational.cpp:(.text+0xce8): undefined reference to `__gmpq_clear'
/usr/bin/ld: rational.cpp:(.text+0xdfb): undefined reference to `__gmpz_ui_pow_ui'
/usr/bin/ld: rational.cpp:(.text+0xe06): undefined reference to `__gmpq_set_z'
/usr/bin/ld: rational.cpp:(.text+0xe15): undefined reference to `__gmpq_mul'
/usr/bin/ld: rational.cpp:(.text+0xe82): undefined reference to `__gmpz_ui_pow_ui'
/usr/bin/ld: rational.cpp:(.text+0xe8d): undefined reference to `__gmpq_set_z'
/usr/bin/ld: rational.cpp:(.text+0xe9c): undefined reference to `__gmpq_div'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator<<(std::ostream&, soplex::Rational const&)':
rational.cpp:(.text+0xede): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rational.cpp:(.text+0xeef): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rational.cpp:(.text+0xf0c): undefined reference to `__gmpq_get_str'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator==(soplex::Rational const&, soplex::Rational const&)':
rational.cpp:(.text+0xf7f): undefined reference to `__gmpq_equal'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator!=(soplex::Rational const&, soplex::Rational const&)':
rational.cpp:(.text+0xf9f): undefined reference to `__gmpq_equal'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator<(soplex::Rational const&, soplex::Rational const&)':
rational.cpp:(.text+0xfbf): undefined reference to `__gmpq_cmp'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator<=(soplex::Rational const&, soplex::Rational const&)':
rational.cpp:(.text+0xfdf): undefined reference to `__gmpq_cmp'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator>(soplex::Rational const&, soplex::Rational const&)':
rational.cpp:(.text+0xfff): undefined reference to `__gmpq_cmp'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::operator>=(soplex::Rational const&, soplex::Rational const&)':
rational.cpp:(.text+0x101f): undefined reference to `__gmpq_cmp'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::totalSizeRational(soplex::Rational const*, int, int)':
rational.cpp:(.text+0x108e): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rational.cpp:(.text+0x109d): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::dlcmSizeRational(soplex::Rational const*, int, int)':
rational.cpp:(.text+0x1103): undefined reference to `__gmpz_init_set_ui'
/usr/bin/ld: rational.cpp:(.text+0x1132): undefined reference to `__gmpz_lcm'
/usr/bin/ld: rational.cpp:(.text+0x1142): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: rational.cpp:(.text+0x114d): undefined reference to `__gmpz_clear'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::dmaxSizeRational(soplex::Rational const*, int, int)':
rational.cpp:(.text+0x11b2): undefined reference to `__gmpz_sizeinbase'
/usr/bin/ld: /home/fabio/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid/lib/libsoplex.a(rational.cpp.o): in function `soplex::rationalToString[abi:cxx11](soplex::Rational const&, int)':
rational.cpp:(.text+0x1245): undefined reference to `__gmpf_init2'
/usr/bin/ld: rational.cpp:(.text+0x1251): undefined reference to `__gmpf_set_q'
/usr/bin/ld: rational.cpp:(.text+0x1267): undefined reference to `__gmpf_out_str'
/usr/bin/ld: rational.cpp:(.text+0x1274): undefined reference to `__gmpf_clear'
/usr/bin/ld:
[.....]
I think that there must be a problem linking the libraries of gmp, can anybody please help me?
The library gmp is here:
fabio#canarino3:~/Dropbox/WORKING/SETUP_BPP_CODE/soplex-5.0.1/buid$ grep gmp soplex-targets.cmake
INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libgmp.so;/usr/lib/x86_64-linux-gnu/libgmpxx.so;quadmath"
INTERFACE_LINK_LIBRARIES "/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libgmp.so;/usr/lib/x86_64-linux-gnu/libgmpxx.so;quadmath"
I've built soplex from source, dowloaded from the scip webpage
Do you have an example of makefile in which soplex is linked?
MANY THANKS!!!!

How to fix "undefined reference to `YAML::operator<<(std::ostream&, YAML::Node const&)'" in cmake

I did a project in manjaro, then decided to switch to ubuntu and everything flew to hell. I've installed libpoco-dev, libtinyxml2-dev and libyaml-cpp-dev
my cmakelist file:
cmake_minimum_required(VERSION 3.13)
project(auchan_handler_microservice)
set(CMAKE_CXX_STANDARD 17)
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
set(LIB_DIR "${PROJECT_SOURCE_DIR}/extern")
add_executable(auchan_handler_microservice main.cc)
include_directories(src)
add_subdirectory(src)
option(PACKAGE_TESTS "Build the tests" ON)
if (PACKAGE_TESTS)
enable_testing()
add_subdirectory(tests)
endif ()
find_package(Poco REQUIRED Foundation Net Util DataMySQL)
target_link_libraries(auchan_handler_microservice src)
target_link_libraries(auchan_handler_microservice yaml-cpp tinyxml2)
target_link_libraries(auchan_handler_microservice Poco::Net Poco::Util Poco::DataMySQL)
error:
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Application::main(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:29: undefined reference to `YAML::LoadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:31: undefined reference to `YAML::operator<<(std::ostream&, YAML::Node const&)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServerParams::HTTPServerParams()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::ServerSocket::ServerSocket(unsigned short, int)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServer::HTTPServer(Poco::SharedPtr<Poco::Net::HTTPRequestHandlerFactory, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Net::HTTPRequestHandlerFactory> >, Poco::Net::ServerSocket const&, Poco::AutoPtr<Poco::Net::HTTPServerParams>)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::ServerSocket::~ServerSocket()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:39: undefined reference to `Poco::Net::TCPServer::start()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:41: undefined reference to `Poco::Util::ServerApplication::waitForTerminationRequest()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServer::~HTTPServer()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::ServerSocket::~ServerSocket()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.cc:38: undefined reference to `Poco::Net::HTTPServer::~HTTPServer()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv4SocketAddressImpl::host() const':
/usr/include/Poco/Net/SocketAddressImpl.h:81: undefined reference to `Poco::Net::IPAddress::IPAddress(void const*, unsigned int)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv6SocketAddressImpl::host() const':
/usr/include/Poco/Net/SocketAddressImpl.h:143: undefined reference to `Poco::Net::IPAddress::IPAddress(void const*, unsigned int, unsigned int)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Exception::Exception(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/exceptions.h:122: undefined reference to `vtable for YAML::Exception'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::RepresentationException::RepresentationException(YAML::Mark const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/exceptions.h:155: undefined reference to `vtable for YAML::RepresentationException'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::InvalidNode::InvalidNode()':
/usr/include/yaml-cpp/exceptions.h:198: undefined reference to `vtable for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::BadSubscript::BadSubscript()':
/usr/include/yaml-cpp/exceptions.h:228: undefined reference to `vtable for YAML::BadSubscript'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::memory_holder::create_node()':
/usr/include/yaml-cpp/node/detail/memory.h:37: undefined reference to `YAML::detail::memory::create_node()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node_ref::mark_defined()':
/usr/include/yaml-cpp/node/detail/node_ref.h:30: undefined reference to `YAML::detail::node_data::mark_defined()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node_ref::set_null()':
/usr/include/yaml-cpp/node/detail/node_ref.h:36: undefined reference to `YAML::detail::node_data::set_null()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node_ref::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/node/detail/node_ref.h:37: undefined reference to `YAML::detail::node_data::set_scalar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node::EnsureNodeExists() const':
/usr/include/yaml-cpp/node/impl.h:54: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:54: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node::Type() const':
/usr/include/yaml-cpp/node/impl.h:78: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:78: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node::Scalar[abi:cxx11]() const':
/usr/include/yaml-cpp/node/impl.h:158: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:158: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:159: undefined reference to `YAML::detail::node_data::empty_scalar[abi:cxx11]'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `void YAML::Node::Assign<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/yaml-cpp/node/impl.h:222: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:222: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `HandlerFactory::HandlerFactory()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler_factory/handler_factory.h:9: undefined reference to `Poco::Net::HTTPRequestHandlerFactory::HTTPRequestHandlerFactory()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::Node YAML::Node::operator[]<char [5]>(char const (&) [5])':
/usr/include/yaml-cpp/node/impl.h:388: undefined reference to `YAML::InvalidNode::~InvalidNode()'
/usr/bin/ld: /usr/include/yaml-cpp/node/impl.h:388: undefined reference to `typeinfo for YAML::InvalidNode'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node& YAML::detail::node_data::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
/usr/include/yaml-cpp/node/detail/impl.h:112: undefined reference to `YAML::detail::node_data::convert_to_map(std::shared_ptr<YAML::detail::memory_holder>)'
/usr/bin/ld: /usr/include/yaml-cpp/node/detail/impl.h:115: undefined reference to `YAML::BadSubscript::~BadSubscript()'
/usr/bin/ld: /usr/include/yaml-cpp/node/detail/impl.h:115: undefined reference to `typeinfo for YAML::BadSubscript'
/usr/bin/ld: /usr/include/yaml-cpp/node/detail/impl.h:126: undefined reference to `YAML::detail::node_data::insert_map_pair(YAML::detail::node&, YAML::detail::node&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `YAML::detail::node& YAML::detail::node_data::convert_to_node<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::shared_ptr<YAML::detail::memory_holder>)':
/usr/include/yaml-cpp/node/detail/impl.h:179: undefined reference to `YAML::detail::memory_holder::merge(YAML::detail::memory_holder&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x20): undefined reference to `Poco::Util::Application::name() const'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x28): undefined reference to `Poco::Util::Application::initialize(Poco::Util::Application&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x30): undefined reference to `Poco::Util::Application::uninitialize()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x38): undefined reference to `Poco::Util::Application::reinitialize(Poco::Util::Application&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x40): undefined reference to `Poco::Util::ServerApplication::defineOptions(Poco::Util::OptionSet&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x48): undefined reference to `Poco::Util::ServerApplication::run()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTV11Application[_ZTV11Application]+0x50): undefined reference to `Poco::Util::Application::handleOption(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Application::~Application()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/server_application/app.h:11: undefined reference to `Poco::Util::ServerApplication::~ServerApplication()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE]+0x50): undefined reference to `Poco::Net::Impl::IPv6SocketAddressImpl::toString[abi:cxx11]() const'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv6SocketAddressImpl::~IPv6SocketAddressImpl()':
/usr/include/Poco/Net/SocketAddressImpl.h:118: undefined reference to `Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTVN4Poco3Net4Impl21IPv4SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv4SocketAddressImplE]+0x50): undefined reference to `Poco::Net::Impl::IPv4SocketAddressImpl::toString[abi:cxx11]() const'
/usr/bin/ld: ../src/libsrc.a(app.cc.o): in function `Poco::Net::Impl::IPv4SocketAddressImpl::~IPv4SocketAddressImpl()':
/usr/include/Poco/Net/SocketAddressImpl.h:56: undefined reference to `Poco::Net::Impl::SocketAddressImpl::~SocketAddressImpl()'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTIN4Poco3Net4Impl21IPv6SocketAddressImplE[_ZTIN4Poco3Net4Impl21IPv6SocketAddressImplE]+0x10): undefined reference to `typeinfo for Poco::Net::Impl::SocketAddressImpl'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTIN4Poco3Net4Impl21IPv4SocketAddressImplE[_ZTIN4Poco3Net4Impl21IPv4SocketAddressImplE]+0x10): undefined reference to `typeinfo for Poco::Net::Impl::SocketAddressImpl'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.ro._ZTI11Application[_ZTI11Application]+0x10): undefined reference to `typeinfo for Poco::Util::ServerApplication'
/usr/bin/ld: ../src/libsrc.a(app.cc.o):(.data.rel.local.DW.ref._ZTIN4YAML9ExceptionE[DW.ref._ZTIN4YAML9ExceptionE]+0x0): undefined reference to `typeinfo for YAML::Exception'
/usr/bin/ld: ../src/libsrc.a(handler_factory.cc.o): in function `RequestHandler::RequestHandler()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.h:9: undefined reference to `Poco::Net::HTTPRequestHandler::HTTPRequestHandler()'
/usr/bin/ld: ../src/libsrc.a(handler_factory.cc.o): in function `HandlerFactory::~HandlerFactory()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler_factory/handler_factory.h:9: undefined reference to `Poco::Net::HTTPRequestHandlerFactory::~HTTPRequestHandlerFactory()'
/usr/bin/ld: ../src/libsrc.a(handler_factory.cc.o):(.data.rel.ro._ZTI14HandlerFactory[_ZTI14HandlerFactory]+0x10): undefined reference to `typeinfo for Poco::Net::HTTPRequestHandlerFactory'
/usr/bin/ld: ../src/libsrc.a(request_handler.cc.o): in function `RequestHandler::handleRequest(Poco::Net::HTTPServerRequest&, Poco::Net::HTTPServerResponse&)':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:20: undefined reference to `Poco::Net::HTTPMessage::getContentLength() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:22: undefined reference to `Poco::Net::HTTPResponse::setStatus(Poco::Net::HTTPResponse::HTTPStatus)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:24: undefined reference to `Poco::Net::HTTPMessage::getContentLength() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:27: undefined reference to `Poco::Net::HTTPRequest::HTTP_POST[abi:cxx11]'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:29: undefined reference to `Poco::Net::HTTPMessage::getContentLength() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:32: undefined reference to `tinyxml2::XMLDocument::XMLDocument(bool, tinyxml2::Whitespace)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:33: undefined reference to `tinyxml2::XMLDocument::Parse(char const*, unsigned long)'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:36: undefined reference to `tinyxml2::XMLElement::GetText() const'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:32: undefined reference to `tinyxml2::XMLDocument::~XMLDocument()'
/usr/bin/ld: /home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.cc:32: undefined reference to `tinyxml2::XMLDocument::~XMLDocument()'
/usr/bin/ld: ../src/libsrc.a(request_handler.cc.o): in function `RequestHandler::~RequestHandler()':
/home/sschiz/CLionProjects/auchan-handler-microservice/src/request_handler/request_handler.h:9: undefined reference to `Poco::Net::HTTPRequestHandler::~HTTPRequestHandler()'
/usr/bin/ld: ../src/libsrc.a(request_handler.cc.o):(.data.rel.ro._ZTI14RequestHandler[_ZTI14RequestHandler]+0x10): undefined reference to `typeinfo for Poco::Net::HTTPRequestHandler'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/list_status_path_test.dir/build.make:100: tests/list_status_path_test] Ошибка 1
make[1]: *** [CMakeFiles/Makefile2:190: tests/CMakeFiles/list_status_path_test.dir/all] Ошибка 2
make: *** [Makefile:141: all]

openGL superbible source code compilation error

I've just started to learn openGL programming with the openGL Superbible. Unfortunately I'm not able compile any example. I'm on Ubuntu 18.10 and I prepared the development environment with these packages from the official repository:
mesa-common-dev (with these package you get header files in /usr/include/GL/)
libglfw3-dev (header files in /usr/include/GLFW/)
The book uses a small framework with an entry point in the sb7.h header (in the book source code), sb7.h then points to glfw3 and gl3w (the latter given with the book's source code, so you don't need to download it).
This is the first example from the book:
#ifndef _LINUX
#define _LINUX
#endif
// Include the "sb7.h" header file
#include "sb7.h"
// Derive my_application from sb7::application
class my_application : public sb7::application
{
public:
// Our rendering function
void render(double currentTime)
{
// Simply clear the window with red
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);
If I try to compile it (the file is called 'main.cpp') with g++ main.cpp -lglfw I get this error:
/usr/bin/ld: /tmp/ccDOdloQ.o: in function `sb7::application::run(sb7::application*)':
main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x1c): undefined reference to `sb7::application::app'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x27e): undefined reference to `gl3wInit'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x29f): undefined reference to `gl3wIsSupported'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2af): undefined reference to `gl3wDebugMessageCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2bd): undefined reference to `sb7::application::debug_callback(unsigned int, unsigned int, unsigned int, unsigned int, int, char const*, void*)'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2c9): undefined reference to `gl3wEnable'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2de): undefined reference to `sb6IsExtensionSupported(char const*)'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2ee): undefined reference to `gl3wDebugMessageCallbackARB'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2fc): undefined reference to `sb7::application::debug_callback(unsigned int, unsigned int, unsigned int, unsigned int, int, char const*, void*)'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x308): undefined reference to `gl3wEnable'
/usr/bin/ld: /tmp/ccDOdloQ.o: in function `sb7::application::glfw_onResize(GLFWwindow*, int, int)':
main.cpp:(.text._ZN3sb711application13glfw_onResizeEP10GLFWwindowii[_ZN3sb711application13glfw_onResizeEP10GLFWwindowii]+0x15): undefined reference to `sb7::application::app'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application13glfw_onResizeEP10GLFWwindowii[_ZN3sb711application13glfw_onResizeEP10GLFWwindowii]+0x1c): undefined reference to `sb7::application::app'
/usr/bin/ld: /tmp/ccDOdloQ.o: in function `sb7::application::glfw_onKey(GLFWwindow*, int, int, int, int)':
main.cpp:(.text._ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii[_ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii]+0x1c): undefined reference to `sb7::application::app'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii[_ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii]+0x23): undefined reference to `sb7::application::app'
/usr/bin/ld: /tmp/ccDOdloQ.o: in function `sb7::application::glfw_onMouseButton(GLFWwindow*, int, int, int)':
main.cpp:(.text._ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii[_ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii]+0x18): undefined reference to `sb7::application::app'
/usr/bin/ld: /tmp/ccDOdloQ.o:main.cpp:(.text._ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii[_ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii]+0x1f): more undefined references to `sb7::application::app' follow
/usr/bin/ld: /tmp/ccDOdloQ.o: in function `my_application::render(double)':
main.cpp:(.text._ZN14my_application6renderEd[_ZN14my_application6renderEd]+0x14): undefined reference to `gl3wClearBufferfv'
collect2: error: ld returned 1 exit status
Reading the messages I thought that something was wrong with the gl3w library, so I downloaded it from the github repository and I put it and glcorearb.h in /usr/include/GL/, pointing the #include in sb7.h to that folder. Eventually I compiled gl3w.c and linked it to main.cpp with g++ as written here:
g++ -c gl3w.c
g++ -c main.cpp
g++ gl3w.o main.o
but when I execute 3) I get other errors:
/usr/bin/ld: gl3w.o: in function `open_libgl()':
gl3w.c:(.text+0x16): undefined reference to `dlopen'
/usr/bin/ld: gl3w.c:(.text+0x4d): undefined reference to `dlsym'
/usr/bin/ld: gl3w.o: in function `close_libgl()':
gl3w.c:(.text+0x6f): undefined reference to `dlclose'
/usr/bin/ld: gl3w.o: in function `get_proc(char const*)':
gl3w.c:(.text+0xc5): undefined reference to `dlsym'
/usr/bin/ld: main.o: in function `sb7::application::run(sb7::application*)':
main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x1c): undefined reference to `sb7::application::app'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x21): undefined reference to `glfwInit'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x7c): undefined reference to `glfwWindowHint'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x92): undefined reference to `glfwWindowHint'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0xb3): undefined reference to `glfwWindowHint'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0xd4): undefined reference to `glfwWindowHint'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0xe3): undefined reference to `glfwWindowHint'
/usr/bin/ld: main.o:main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0xf2): more undefined references to `glfwWindowHint' follow
/usr/bin/ld: main.o: in function `sb7::application::run(sb7::application*)':
main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x13f): undefined reference to `glfwGetPrimaryMonitor'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x172): undefined reference to `glfwCreateWindow'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x1c8): undefined reference to `glfwMakeContextCurrent'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x1e2): undefined reference to `glfwSetWindowSizeCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x1fc): undefined reference to `glfwSetKeyCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x216): undefined reference to `glfwSetMouseButtonCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x230): undefined reference to `glfwSetCursorPosCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x24a): undefined reference to `glfwSetScrollCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x279): undefined reference to `glfwSetInputMode'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2af): undefined reference to `gl3wDebugMessageCallback'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2bd): undefined reference to `sb7::application::debug_callback(unsigned int, unsigned int, unsigned int, unsigned int, int, char const*, void*)'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2c9): undefined reference to `gl3wEnable'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2de): undefined reference to `sb6IsExtensionSupported(char const*)'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2ee): undefined reference to `gl3wDebugMessageCallbackARB'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x2fc): undefined reference to `sb7::application::debug_callback(unsigned int, unsigned int, unsigned int, unsigned int, int, char const*, void*)'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x308): undefined reference to `gl3wEnable'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x339): undefined reference to `glfwGetTime'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x355): undefined reference to `glfwSwapBuffers'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x35a): undefined reference to `glfwPollEvents'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x372): undefined reference to `glfwGetKey'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x39b): undefined reference to `glfwWindowShouldClose'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x3e7): undefined reference to `glfwDestroyWindow'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application3runEPS0_[_ZN3sb711application3runEPS0_]+0x3ec): undefined reference to `glfwTerminate'
/usr/bin/ld: main.o: in function `sb7::application::glfw_onResize(GLFWwindow*, int, int)':
main.cpp:(.text._ZN3sb711application13glfw_onResizeEP10GLFWwindowii[_ZN3sb711application13glfw_onResizeEP10GLFWwindowii]+0x15): undefined reference to `sb7::application::app'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application13glfw_onResizeEP10GLFWwindowii[_ZN3sb711application13glfw_onResizeEP10GLFWwindowii]+0x1c): undefined reference to `sb7::application::app'
/usr/bin/ld: main.o: in function `sb7::application::glfw_onKey(GLFWwindow*, int, int, int, int)':
main.cpp:(.text._ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii[_ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii]+0x1c): undefined reference to `sb7::application::app'
/usr/bin/ld: main.cpp:(.text._ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii[_ZN3sb711application10glfw_onKeyEP10GLFWwindowiiii]+0x23): undefined reference to `sb7::application::app'
/usr/bin/ld: main.o: in function `sb7::application::glfw_onMouseButton(GLFWwindow*, int, int, int)':
main.cpp:(.text._ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii[_ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii]+0x18): undefined reference to `sb7::application::app'
/usr/bin/ld: main.o:main.cpp:(.text._ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii[_ZN3sb711application18glfw_onMouseButtonEP10GLFWwindowiii]+0x1f): more undefined references to `sb7::application::app' follow
/usr/bin/ld: main.o: in function `my_application::render(double)':
main.cpp:(.text._ZN14my_application6renderEd[_ZN14my_application6renderEd]+0x14): undefined reference to `gl3wClearBufferfv'
collect2: error: ld returned 1 exit status
At this point I tried with the single file version of gl3w.h which already includes gl3w.c. I put the two headers in /usr/include/GL/ and then I pointed sb7.h to that version of the library, but other errors appeared with g++ main.cpp -lglfw:
In file included from main.cpp:6:
sb7.h: In member function ‘virtual void sb7::application::run(sb7::application*)’:
sb7.h:137:9: error: ‘gl3wInit’ was not declared in this scope
gl3wInit();
^~~~~~~~
sb7.h:137:9: note: suggested alternative: ‘glfwInit’
gl3wInit();
^~~~~~~~
glfwInit
sb7.h:147:17: error: ‘gl3wIsSupported’ was not declared in this scope
if (gl3wIsSupported(4, 3))
^~~~~~~~~~~~~~~
sb7.h:147:17: note: suggested alternative: ‘gl3w_is_supported’
if (gl3wIsSupported(4, 3))
^~~~~~~~~~~~~~~
gl3w_is_supported
I also added #define GL3W_IMPLEMENTATION before #include "GL/gl3w.h" as suggested in the documentation of the single file version of gl3w but with no luck.
I get the same errors with the other book's source codes.
Hope that someone can help me.
Thank you.