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

Compiler error when using Visual Studio 2015 on Windows 7 #247

Closed
strrchr opened this issue Jan 3, 2016 · 2 comments
Closed

Compiler error when using Visual Studio 2015 on Windows 7 #247

strrchr opened this issue Jan 3, 2016 · 2 comments

Comments

@strrchr
Copy link

strrchr commented Jan 3, 2016

d:\home\js\modules_by_npm\node_modules\leveldown\deps\leveldb\port-libuv\stdint-msvc2008.h(109): error C2371: 'uint_fast16_t': red efinition; different basic types (compiling source file leveldb-1.18.0\db\filename.cc) [D:\home\js\modules_by_npm\node_modules\lev eldown\deps\leveldb\leveldb.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdint.h(40): note: see declaration of 'uint_fast16_t' (compiling
   source file leveldb-1.18.0\db\filename.cc)

The errors are like the above.
I modify some part of deps\leveldb\port-libuv\port_uv.h from

#elif defined(_MSC_VER)
  #include "stdint-msvc2008.h"
  #define PLATFORM_IS_LITTLE_ENDIAN true
  #define snprintf _snprintf

to

#elif defined(_MSC_VER)
// MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015)
#if _MSC_VER < 1900
  #include "stdint-msvc2008.h"
#endif
  #define PLATFORM_IS_LITTLE_ENDIAN true
#if _MSC_VER < 1900
  #define snprintf _snprintf
#endif

Then the compilation is OK.
Is it the correct solution?
It would be nice if the problem is fixed.

@obastemur
Copy link
Contributor

Looks like I forgot bringing the fix from leveldown-mobile https://github.com/Level/leveldown-mobile/blob/master/deps/leveldb/port-libuv/port_uv.h#L29-L33

@strrchr almost correct solution. I'm going to PR port_uv.h from leveldown-mobile and see what other folks will say.

obastemur added a commit to obastemur/leveldown that referenced this issue Jan 24, 2016
Most probably also fixes Level#213
@ralphtheninja
Copy link
Member

Then the compilation is OK.
Is it the correct solution?
It would be nice if the problem is fixed.

If it compiles the tests run it should be OK. At least an improvement from not compiling :)

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

3 participants