You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm trying to make binding for LightGBM through their c_api.h (inspired by lightgbm3-rs which have the same issue).
Building the bindings works as expected, but building the tests results in a linking error (see below).
This is only an issue for stable rustc (I'm using 1.78.0), and NOT for 1.80.0-nightly.
Reproduced the issue on ubuntu, debian, pop-os and the rust docker image (debian) with Dockerfile.
I'm using bindgen version 0.69.4 (I've tried older versions back to 0.51)
$ cargo build --tests # cargo test give same error
error: linking with `cc` failed: exit status: 1
|
= note: LC_ALL="C" PATH="/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/haavard/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcZZ6oSb/symbols.o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11.1o6nyyjmhvrn2ll5.rcgu.o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11.3hgz4k0z3gxo5cjm.rcgu.o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11.3rektmgsb73o6y34.rcgu.o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11.4rt9zigxr3m814r6.rcgu.o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11.crb7bfbeaxtt02w.rcgu.o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11.5bi259f3i9x9fdu5.rcgu.o" "-Wl,--as-needed" "-L" "/home/haavard/aleph/target/debug/deps" "-L" "/home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib" "-L" "/home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out" "-L" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-lstdc++" "-lgomp" "-Wl,-Bstatic" "-Wl,--whole-archive" "-l_lightgbm" "-Wl,--no-whole-archive" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-da8dbafd4eb32b5e.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-f710a6c4aea91573.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode_width-ec680785f16b10cf.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std-e4d24bd7b0aba56e.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d2ef02247056996e.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fde67f6c4eccaa42.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-2549d0ec992a5666.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-bb9bfc0931d5cad0.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-7c0b91fdc4adc2c5.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-6ec164769e6c2957.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-95326caaef561554.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-704dba0df3717bb7.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-5f0117cb69112303.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-7a95907f1ed0cea5.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-d4aa666f8242aefc.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-9abec8861e966bc7.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-863ac378b60eeb30.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-fc8aa5b7d220f0a9.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-0cc850f1e941238d.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-f7b445210e88e768.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-f37052492751c579.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-fd15ec7f305d48e7.rlib" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-d700583125da6701.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/haavard/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/haavard/aleph/target/debug/deps/lightgbm_sys-a374ee4f34550c11" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: /usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(c_api.cpp.o): in function `_GLOBAL__sub_I_c_api.cpp':
c_api.cpp:(.text.startup._GLOBAL__sub_I_c_api.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: c_api.cpp:(.text.startup._GLOBAL__sub_I_c_api.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(boosting.cpp.o): in function `_GLOBAL__sub_I_boosting.cpp':
boosting.cpp:(.text.startup._GLOBAL__sub_I_boosting.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: boosting.cpp:(.text.startup._GLOBAL__sub_I_boosting.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(gbdt.cpp.o): in function `_GLOBAL__sub_I_gbdt.cpp':
gbdt.cpp:(.text.startup._GLOBAL__sub_I_gbdt.cpp+0x1d): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: gbdt.cpp:(.text.startup._GLOBAL__sub_I_gbdt.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(gbdt_model_text.cpp.o): in function `_GLOBAL__sub_I_gbdt_model_text.cpp':
gbdt_model_text.cpp:(.text.startup._GLOBAL__sub_I_gbdt_model_text.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: gbdt_model_text.cpp:(.text.startup._GLOBAL__sub_I_gbdt_model_text.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(gbdt_prediction.cpp.o): in function `_GLOBAL__sub_I_gbdt_prediction.cpp':
gbdt_prediction.cpp:(.text.startup._GLOBAL__sub_I_gbdt_prediction.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: gbdt_prediction.cpp:(.text.startup._GLOBAL__sub_I_gbdt_prediction.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(prediction_early_stop.cpp.o): in function `_GLOBAL__sub_I_prediction_early_stop.cpp':
prediction_early_stop.cpp:(.text.startup._GLOBAL__sub_I_prediction_early_stop.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: prediction_early_stop.cpp:(.text.startup._GLOBAL__sub_I_prediction_early_stop.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(sample_strategy.cpp.o): in function `_GLOBAL__sub_I_sample_strategy.cpp':
sample_strategy.cpp:(.text.startup._GLOBAL__sub_I_sample_strategy.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: sample_strategy.cpp:(.text.startup._GLOBAL__sub_I_sample_strategy.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(bin.cpp.o): in function `_GLOBAL__sub_I_bin.cpp':
bin.cpp:(.text.startup._GLOBAL__sub_I_bin.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: bin.cpp:(.text.startup._GLOBAL__sub_I_bin.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(config.cpp.o): in function `_GLOBAL__sub_I_config.cpp':
config.cpp:(.text.startup._GLOBAL__sub_I_config.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: config.cpp:(.text.startup._GLOBAL__sub_I_config.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(config_auto.cpp.o): in function `_GLOBAL__sub_I_config_auto.cpp':
config_auto.cpp:(.text.startup._GLOBAL__sub_I_config_auto.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: config_auto.cpp:(.text.startup._GLOBAL__sub_I_config_auto.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(dataset.cpp.o): in function `_GLOBAL__sub_I_dataset.cpp':
dataset.cpp:(.text.startup._GLOBAL__sub_I_dataset.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: dataset.cpp:(.text.startup._GLOBAL__sub_I_dataset.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(dataset_loader.cpp.o): in function `_GLOBAL__sub_I_dataset_loader.cpp':
dataset_loader.cpp:(.text.startup._GLOBAL__sub_I_dataset_loader.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: dataset_loader.cpp:(.text.startup._GLOBAL__sub_I_dataset_loader.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(file_io.cpp.o): in function `_GLOBAL__sub_I_file_io.cpp':
file_io.cpp:(.text.startup._GLOBAL__sub_I_file_io.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: file_io.cpp:(.text.startup._GLOBAL__sub_I_file_io.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(json11.cpp.o): in function `_GLOBAL__sub_I_json11.cpp':
json11.cpp:(.text.startup._GLOBAL__sub_I_json11.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: json11.cpp:(.text.startup._GLOBAL__sub_I_json11.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(metadata.cpp.o): in function `_GLOBAL__sub_I_metadata.cpp':
metadata.cpp:(.text.startup._GLOBAL__sub_I_metadata.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: metadata.cpp:(.text.startup._GLOBAL__sub_I_metadata.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(parser.cpp.o): in function `_GLOBAL__sub_I_parser.cpp':
parser.cpp:(.text.startup._GLOBAL__sub_I_parser.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: parser.cpp:(.text.startup._GLOBAL__sub_I_parser.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(train_share_states.cpp.o): in function `_GLOBAL__sub_I_train_share_states.cpp':
train_share_states.cpp:(.text.startup._GLOBAL__sub_I_train_share_states.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: train_share_states.cpp:(.text.startup._GLOBAL__sub_I_train_share_states.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(tree.cpp.o): in function `_GLOBAL__sub_I_tree.cpp':
tree.cpp:(.text.startup._GLOBAL__sub_I_tree.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: tree.cpp:(.text.startup._GLOBAL__sub_I_tree.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(dcg_calculator.cpp.o): in function `std::vector<double, std::allocator<double> >::~vector()':
dcg_calculator.cpp:(.text._ZNSt6vectorIdSaIdEED2Ev[_ZNSt6vectorIdSaIdEED5Ev]+0xd): undefined reference to `operator delete(void*)'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(dcg_calculator.cpp.o): in function `_GLOBAL__sub_I_dcg_calculator.cpp':
dcg_calculator.cpp:(.text.startup._GLOBAL__sub_I_dcg_calculator.cpp+0x1d): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: dcg_calculator.cpp:(.text.startup._GLOBAL__sub_I_dcg_calculator.cpp+0x24): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(metric.cpp.o): in function `_GLOBAL__sub_I_metric.cpp':
metric.cpp:(.text.startup._GLOBAL__sub_I_metric.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: metric.cpp:(.text.startup._GLOBAL__sub_I_metric.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(linker_topo.cpp.o): in function `_GLOBAL__sub_I_linker_topo.cpp':
linker_topo.cpp:(.text.startup._GLOBAL__sub_I_linker_topo.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: linker_topo.cpp:(.text.startup._GLOBAL__sub_I_linker_topo.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(linkers_socket.cpp.o): in function `_GLOBAL__sub_I_linkers_socket.cpp':
linkers_socket.cpp:(.text.startup._GLOBAL__sub_I_linkers_socket.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: linkers_socket.cpp:(.text.startup._GLOBAL__sub_I_linkers_socket.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(network.cpp.o): in function `_GLOBAL__sub_I_network.cpp':
network.cpp:(.text.startup._GLOBAL__sub_I_network.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: network.cpp:(.text.startup._GLOBAL__sub_I_network.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(objective_function.cpp.o): in function `_GLOBAL__sub_I_objective_function.cpp':
objective_function.cpp:(.text.startup._GLOBAL__sub_I_objective_function.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: objective_function.cpp:(.text.startup._GLOBAL__sub_I_objective_function.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(data_parallel_tree_learner.cpp.o): in function `_GLOBAL__sub_I_data_parallel_tree_learner.cpp':
data_parallel_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_data_parallel_tree_learner.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: data_parallel_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_data_parallel_tree_learner.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(feature_parallel_tree_learner.cpp.o): in function `_GLOBAL__sub_I_feature_parallel_tree_learner.cpp':
feature_parallel_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_feature_parallel_tree_learner.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: feature_parallel_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_feature_parallel_tree_learner.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(gradient_discretizer.cpp.o): in function `_GLOBAL__sub_I_gradient_discretizer.cpp':
gradient_discretizer.cpp:(.text.startup._GLOBAL__sub_I_gradient_discretizer.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: gradient_discretizer.cpp:(.text.startup._GLOBAL__sub_I_gradient_discretizer.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(linear_tree_learner.cpp.o): in function `_GLOBAL__sub_I_linear_tree_learner.cpp':
linear_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_linear_tree_learner.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: linear_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_linear_tree_learner.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(serial_tree_learner.cpp.o): in function `_GLOBAL__sub_I_serial_tree_learner.cpp':
serial_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_serial_tree_learner.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: serial_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_serial_tree_learner.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(tree_learner.cpp.o): in function `_GLOBAL__sub_I_tree_learner.cpp':
tree_learner.cpp:(.text.startup._GLOBAL__sub_I_tree_learner.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: tree_learner.cpp:(.text.startup._GLOBAL__sub_I_tree_learner.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
/usr/bin/ld: /home/haavard/aleph/target/debug/build/lightgbm-sys-b2f1be85a3fa4ab2/out/lib/lib_lightgbm.a(voting_parallel_tree_learner.cpp.o): in function `_GLOBAL__sub_I_voting_parallel_tree_learner.cpp':
voting_parallel_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_voting_parallel_tree_learner.cpp+0x10): undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: voting_parallel_tree_learner.cpp:(.text.startup._GLOBAL__sub_I_voting_parallel_tree_learner.cpp+0x17): undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
error: could not compile `lightgbm-sys` (lib test) due to 1 previous error
The text was updated successfully, but these errors were encountered:
havakv
changed the title
Building test for LightGBM bindings failes with linker error
Building tests for LightGBM bindings failes with linker error
May 28, 2024
Hello, I'm trying to make binding for LightGBM through their c_api.h (inspired by lightgbm3-rs which have the same issue).
Building the bindings works as expected, but building the tests results in a linking error (see below).
This is only an issue for stable rustc (I'm using 1.78.0), and NOT for 1.80.0-nightly.
Reproduced the issue on ubuntu, debian, pop-os and the rust docker image (debian) with Dockerfile.
I'm using
bindgen
version0.69.4
(I've tried older versions back to0.51
)My
build.rs
:Anyone able can point me in the right direction?
The text was updated successfully, but these errors were encountered: