clab / dynet

DyNet: The Dynamic Neural Network Toolkit
Apache License 2.0
3.42k stars 704 forks source link

Installation issue - error C2397: conversion from 'unsigned int' to '_Ty' requires a narrowing conversion #1529

Open ntrang086 opened 5 years ago

ntrang086 commented 5 years ago

Need help solving this issue when trying to install Dynet. I've been trying to install it on Windows. I'm using Visual Studio 15 (2017). I downloaded the Eigen version recommended on Dynet's installation page: hg clone https://bitbucket.org/eigen/eigen/ -r b2e267d When I tried to build dynet.sln, I got the error C2397 across multiple files from Eigen. As an example:

2>c:\users\tn\appdata\local\eigen\unsupported\eigen\cxx11\src/Tensor/TensorDimensions.h(289): error C2397: conversion from 'unsigned int' to '_Ty' requires a narrowing conversion 2> with 2> [ 2> _Ty=int 2> ] (compiling source file C:\Users\tn\AppData\Local\dynet\dynet\nodes-concat.cc)

FilippoC commented 5 years ago

The given line is a comment in the source code : https://github.com/clab/dynet/blob/master/dynet/tensor.h#L289

???

ntrang086 commented 5 years ago

@FilippoC , thanks for the quick response. Could you please clarify which line? The error message? I went to the link you provided but didn't see anything.

FilippoC commented 5 years ago

@ntrang086 sorry I was looking at the wrong file. It seems to be a bug related to Visual Studio so I'm afraid I cannot help.

Note that you should check Eigen+Studio compatibility (check the IntelliSense, I honestly don't know much about this environment) : http://eigen.tuxfamily.org/index.php?title=Main_Page#Compiler_support

ntrang086 commented 5 years ago

@FilippoC I disabled IntelliSense as mentioned in the link, but still got the same error.

losper commented 4 years ago

32-bit version may not be supported,you can try -G “Visual Studio 14 2015 Win64”?