Skip to content

Cross compilation errors (cmake cannot find C++ compiler) #10

@ssokolen

Description

@ssokolen

Cross-compiling code that uses nlopt on linux (Manjaro) with x86_64-pc-windows-gnu as target fails because cmake is unable to find an appropriate C++ compiler (using something like /usr/bin/c++ instead of the mingw binaries). I have practically zero cross-compilation experience, but it struck me that the cmake log indicated no issues finding the correct gcc. Taking a look at build.rs for nlopt, I removed the line .define("CMAKE_CXX_COMPILER", "c++") locally and this seemed to fix the issue for me without adding any new issues for linux compilation. I'm not sure what the original role of this line is so I would hesitate to suggest its outright removal, but perhaps its impact on cross-compilation could be investigated further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions