Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking error #18

Open
tprodanov opened this issue Aug 9, 2023 · 2 comments
Open

Linking error #18

tprodanov opened this issue Aug 9, 2023 · 2 comments

Comments

@tprodanov
Copy link

tprodanov commented Aug 9, 2023

I enountered a problem with building a rust program with highs dependency. Currently, if I try to build a very small app,
Cargo.toml:

[dependencies]
highs-sys = "1.5.3"

main.rs:

fn main() {
    let problem = unsafe { highs_sys::Highs_create() };
}

highs-sys is built without problems, but cannot be linked with the main app, generating LD errors
ld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&).

The server is CentOS Linux 7, and it has g++ (GCC) 11.1.0, gcc (GCC) 11.1.0, and GNU ld version 2.27-44.base.el7_9.1.

I tried to modify highs-sys build.rs script, but without success for now.
One additional note: I could not compile HiGHS using clang, as it produces this error:

HiGHS/extern/zstr/zstr.hpp:439:23: error: attempt to use a deleted function
  439 |         std::istream::operator=(std::istream(rdbuf()));

I also tried to compile with older g++/gcc versions (8.1.0), but it produced the same problems.
What could be the possible next steps?

@jajhall
Copy link
Collaborator

jajhall commented Aug 9, 2023

Strange: zstr is not part of HiGHS, and we've never had any problems with it before. Perhaps we need to update the version we're using. Any thoughts @svigerske?

@svigerske
Copy link

svigerske commented Aug 10, 2023

For the linking issue, it may help to see the full build log, so one could get some idea what may have left to this issue. Otherwise, it's even more guessing around.

Updating zstr should help for the 2nd issue, because it would disable the code in question: mateidavid/zstr#61
It looks like zstr is using some C++11 feature (https://en.cppreference.com/w/cpp/io/basic_istream/operator%3D) that some very old compilers do not implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants