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

Unresolved external symbol #77

Closed
CGMossa opened this issue May 4, 2020 · 5 comments
Closed

Unresolved external symbol #77

CGMossa opened this issue May 4, 2020 · 5 comments

Comments

@CGMossa
Copy link

CGMossa commented May 4, 2020

I'm trying to add support for vcpkg as I've found out, that I need to link to this with stable-msvc.

I'm beyond frustrated at this point, but here's where I am at: The build.rs I have right now is this:

extern crate vcpkg;
use std::path::PathBuf;

fn main() {
    std::env::set_var("VCPKGRS_DYNAMIC", "");
    std::env::set_var("RUSTFLAGS", "-Ctarget-feature=+crt-static");
    let gsl_library = vcpkg::Config::new()
        .cargo_metadata(true)
        .emit_includes(true)
        // .copy_dlls(true)
        // .vcpkg_root(PathBuf::from("C:/DEV/vcpkg/"))
        .find_package("gsl")
        .unwrap();
    dbg!(gsl_library);
    println!(r#"cargo:rustc-cfg=feature="v2""#);
}

I've also added default = ["v2"] to Cargo.toml to ensure that it is building the version of gsl that I installed through vcpkg.

The vcpkg crate works like this: If all this was resolved correlty, then the necessary things are emitted.

But I still get all of these as unresolved symbols: They aren't strictly v2 stuff, so I am just very perplexed as to why I'm missing 79 symbols:

``` gsl_odeiv2_step_rk2 gsl_odeiv2_step_rk4 gsl_odeiv2_step_rkf45 gsl_odeiv2_step_rkck gsl_odeiv2_step_rk8pd gsl_odeiv2_step_rk1imp gsl_odeiv2_step_rk2imp gsl_odeiv2_step_rk4imp gsl_odeiv2_step_bsimp gsl_odeiv2_step_msadams gsl_odeiv2_step_msbdf gsl_odeiv2_control_scaled gsl_odeiv2_control_standard gsl_interp_linear gsl_interp_polynomial gsl_interp_cspline gsl_interp_cspline_periodic gsl_interp_akima gsl_interp_akima_periodic gsl_rng_default_seed gsl_rng_default gsl_multifit_fdfsolver_lmder gsl_multifit_fdfsolver_lmsder gsl_qrng_niederreiter_2 gsl_qrng_sobol gsl_qrng_halton gsl_qrng_reversehalton gsl_rng_mt19937 gsl_rng_ranlxs0 gsl_rng_ranlxs1 gsl_rng_ranlxs2 gsl_rng_ranlxd1 gsl_rng_ranlxd2 gsl_rng_ranlux gsl_rng_ranlux389 gsl_rng_cmrg gsl_rng_mrg gsl_rng_taus gsl_rng_taus2 gsl_rng_gfsr4 gsl_rng_ranf gsl_rng_ranmar gsl_rng_r250 gsl_rng_tt800 gsl_rng_vax gsl_rng_transputer gsl_rng_randu gsl_rng_minstd gsl_rng_uni gsl_rng_uni32 gsl_rng_slatec gsl_rng_zuf gsl_rng_knuthran2 gsl_rng_knuthran2002 gsl_rng_knuthran gsl_rng_borosh13 gsl_rng_fishman18 gsl_rng_fishman20 gsl_rng_lecuyer21 gsl_rng_waterman14 gsl_rng_fishman2x gsl_rng_coveyou gsl_rng_rand gsl_rng_random_bsd gsl_rng_random_libc5 gsl_rng_random_glibc2 gsl_rng_rand48 gsl_root_fsolver_bisection gsl_root_fsolver_brent gsl_root_fsolver_falsepos gsl_root_fdfsolver_newton gsl_root_fdfsolver_secant gsl_root_fdfsolver_steffenson gsl_wavelet_daubechies gsl_wavelet_daubechies_centered gsl_wavelet_haar gsl_wavelet_haar_centered gsl_wavelet_bspline gsl_wavelet_bspline_centered ```
@GuillaumeGomez
Copy link
Owner

I never tried to use glsl on Windows, so I think my help will be quite limited... Just in case, do you have the "dev" version? Optional (not sure if relevant...): do you have "glsl_cblas" installed too?

@CGMossa
Copy link
Author

CGMossa commented May 4, 2020

According to the accompanying vcpkg_cli, I do have it installed. I am using the version that vcpkg is installing, which is 2.6.

I am giving up on the vcpkg path. I believe the issue might be a conflict between setting it to link statically or dynamically.

Now, I am trying to find a resource, that explains how the println! emit works, so I can hard-code the gsl version I have to the binary, and see where the problem lies.

It seems like no-one is spending anytime on using GSL and Windows. There's absolutely no resource explaining how any of this works. The only thing I can find is opencv apparently links through vcpkg, but it is so convoluted, that I am not sure it is worth it.

@GuillaumeGomez
Copy link
Owner

Well, windows is a nightmare for developers and most opensource developments are on linux so they generally don't care about windows.

As for the println! thing in the build.rs file, I think you want to take a look here: https://doc.rust-lang.org/cargo/reference/build-scripts.html

@CGMossa
Copy link
Author

CGMossa commented May 4, 2020

Yeah, I've been hammering combinations of these and I am 'bout to fully give up. If anyone knows how to set these things up in Windows, I'd love a conversation, and I'd definitely contribute a PR based on said assistance.

It is just beyond annoying. I have no idea if is cdylib or static or whatever. The error messages are indecipherable.

Sorry.

@GuillaumeGomez
Copy link
Owner

Maybe ask the cargo people for help maybe?

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

2 participants