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.
Cross-compiling code that uses nlopt on linux (Manjaro) with
x86_64-pc-windows-gnuas 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 correctgcc. Taking a look atbuild.rsfor 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.