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

Build error with Visual Studio 2015 Update 1 and 2 #599

Closed
jslee02 opened this issue Jan 31, 2016 · 14 comments
Closed

Build error with Visual Studio 2015 Update 1 and 2 #599

jslee02 opened this issue Jan 31, 2016 · 14 comments

Comments

@jslee02
Copy link
Member

jslee02 commented Jan 31, 2016

Visual Studio 2015 with Update 1 complains in build of the current master branch. It seems VS2015 fails to evaluate a function pointer to a constant.

Here is the error message.

C:\projects\dart\dart/dynamics/Addon.h(63): error C2131: expression did not evaluate to a constant (compiling source file C:\projects\dart\dart\dynamics\BallJoint.cpp) [C:\projects\dart\build\dart\dart-core.vcxproj]
@jturner65
Copy link

yes, i ran into this too. it seems like the most likely cause of this is the constexpr static declarations in addon.h. apparently vs2015's support of constexpr is evolving. notice the link below :

https://blogs.msdn.microsoft.com/vcblog/2015/12/02/constexpr-in-vs2015-update-1/

particularly the looking forward section, where they say there are still numerous bugs remaining, some of which pertain to pointers-to-members in constant expressions.

@jslee02
Copy link
Member Author

jslee02 commented Feb 2, 2016

So sad VS2015 hasn't completed constexpr yet. I hope the next update fix this, and it's before DART 6.0 release.

@jturner65
Copy link

i know, it's unfortunate how long it's taking them to become compliant with the standard.

@jturner65
Copy link

are there any plans to address this?

@jslee02
Copy link
Member Author

jslee02 commented Feb 9, 2016

I don't think there is a way to address this unless VS2015 fixes the bug. One possible way could be not using constexpr, but it is now required feature for DART 6.0 since #531.

Please note that this is an issue for the current master branch (that will be DART 6.0) but not for DART 5.1 or less.

@jturner65
Copy link

this isn't an issue with 5.1 so i guess we can close it, although 5.1 has other problems (Eigen alignment assertions).

@jslee02
Copy link
Member Author

jslee02 commented Feb 10, 2016

The Eigen alignment issue should be addressed by #606.

I would like to leave this issue open to inform this to other users. Someone who tries to build master branch with VS2015 might want to know about this.

@jturner65
Copy link

Excellent! Thanks JS.

@jslee02
Copy link
Member Author

jslee02 commented Feb 12, 2016

I hope the constexpr issue is addressed in VS2015 Update 2 CTP.

@jturner65
Copy link

oh, goody. i'll test it.

@jslee02
Copy link
Member Author

jslee02 commented Feb 12, 2016

The issue seems not resolved yet. I still get the same errors.

@jslee02
Copy link
Member Author

jslee02 commented Apr 7, 2016

Visual Studio 2015 Update 2 still can't build with constexpr for function pointers.

@mxgrey
Copy link
Member

mxgrey commented Apr 7, 2016

If this is becoming a problem, it may be possible to block out those expressions for Visual Studio, and avoid using them in code. Their original purpose was to enable us to use some macros for implementations of classes derived from Addon, but my new implementation (currently being called Aspect) almost completely eliminates the use of those macros.

I should be dropping a huge pull request tomorrow with the new Aspect implementation. To be honest, though, Visual Studio isn't known to be great with templates, and the Aspect implementation is extremely template heavy, so we might end up eliminating one problem while introducing a dozen new ones. I'll start testing the implementation in VS as soon as it's finished.

@jslee02 jslee02 changed the title Build error with Visual Studio 2015 Update 1 Build error with Visual Studio 2015 Update 1 and 2 Apr 22, 2016
@jslee02
Copy link
Member Author

jslee02 commented Jan 12, 2018

We don't test DART 5 for Windows build, but DART 6.3 (and later) works w/ Visual Studio 2017 (see #956).

@jslee02 jslee02 closed this as completed Jan 12, 2018
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