Cannot compile rgsl on windows

Hello,

I am a linux person and did all my dev and testing on linux but now need a windows deployment. Usually this would be easy but I have the GNU Scientific Library as a dependency. I have installed GSL via nuget on windows but I am still getting the following build errors:

(truncated)

          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_ranlux referenced in function _ZN4rgsl5types3rng10algorithms6ranlux17h4b85c35e7bdd2053E
          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_ranlux389 referenced in function _ZN4rgsl5types3rng10algorithms9ranlux38917h1e90ef64af1981f6E
          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_cmrg referenced in function _ZN4rgsl5types3rng10algorithms4cmrg17he9eaacceabea71eeE
          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_mrg referenced in function _ZN4rgsl5types3rng10algorithms3mrg17h61def4c9dec72d23E
          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_taus referenced in function _ZN4rgsl5types3rng10algorithms4taus17h41c53eb39f58b339E
          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_taus2 referenced in function _ZN4rgsl5types3rng10algorithms5taus217ha72053726fa02d46E
          rgsl-ece351c0bd2aea74.rgsl.f5k80kw0-cgu.9.rcgu.o : error LNK2019: unresolved external symbol gsl_rng_gfsr4 referenced in function _ZN4rgsl5types3rng10algorithms5gfsr417hcee61f4156352566E
          C:\Users\mcdan\Desktop\code\rework\target\release\deps\rgsl-ece351c0bd2aea74.dll : fatal error LNK1120: 92 unresolved externals

First I was getting issues around lib files not being found but I moved them into the toolchain directory and now its getting further, but I did have to rename one file from cblas.lib to gslcblas.libas there was nogslcblas.lib` in the library that I installed. But now I am stuck at these "unresolved externals".

Any help would be appreciated!

Hmm... I'm not familiar with this library but I downloaded the package from NuGet Gallery | gsl-msvc14-x64 2.3.0.2779 and manually extracted the contents using an unzip utility. In .\build\native\ there is a file called gslcblas.lib. There is also a static version in the static sub folder.

Thanks Chris. I realized that I was using a 2.4 version off of nuget. I rolled back to the version you mention and do see gslcblas.lib so that was progress, however I am still getting a bunch of unresolved externals.

I specified the version as a feature as is noted in the rgsl readme:


[dependencies]
GSL = {version="3.0.0", features=["v2_3"]}

I have a simple test "hello world" crate with this single dependency defined above but cannot get it to compile.

I installed the 2.3 version of GSL on windows via nuget and used an environment var to point to the directory with the *.lib files.

set RUSTFLAGS=-L C:\Users\...\gsl-msvc14-x64.2.3.0.2779\build\native\

Not sure what else to do at this point. I wonder if this has anything to do with what windows tooling is installed? Like I said I have little windows experience. Any ideas very appreciated!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.