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

Compile errors when using VS 2015 #1567

Closed
NickWaanders opened this issue Dec 6, 2018 · 4 comments
Closed

Compile errors when using VS 2015 #1567

NickWaanders opened this issue Dec 6, 2018 · 4 comments

Comments

@NickWaanders
Copy link
Contributor

Hi,

I am trying to compile bgfx using Visual Studio 2015, and I am getting the following errors:

1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(189): error C3250: 'add': declaration is not allowed in 'constexpr' function body (compiling source file ..\..\..\..\bx\src\easing.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(189): error C3249: illegal statement or sub-expression for 'constexpr' function (compiling source file ..\..\..\..\bx\src\easing.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(190): error C3250: 'lt': declaration is not allowed in 'constexpr' function body (compiling source file ..\..\..\..\bx\src\easing.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(190): error C3249: illegal statement or sub-expression for 'constexpr' function (compiling source file ..\..\..\..\bx\src\easing.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(191): error C3250: 'result': declaration is not allowed in 'constexpr' function body (compiling source file ..\..\..\..\bx\src\easing.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(189): error C3250: 'add': declaration is not allowed in 'constexpr' function body (compiling source file ..\..\..\..\bx\src\bx.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(191): error C3249: illegal statement or sub-expression for 'constexpr' function (compiling source file ..\..\..\..\bx\src\easing.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(189): error C3249: illegal statement or sub-expression for 'constexpr' function (compiling source file ..\..\..\..\bx\src\bx.cpp)
1>c:\bgfx\bx\include\bx\inline/uint32_t.inl(190): error C3250: 'lt': declaration is not allowed in 'constexpr' function body (compiling source file ..\..\..\..\bx\src\bx.cpp)

Is there anything I am doing wrong?

Cheers,
Nick

@mlabbe
Copy link

mlabbe commented Dec 6, 2018

I'm getting these as well when building master branch of bgfx & bx. They go away when using vs2017.

Is there a workaround for earlier vs compilers?

@x1nixmzeng
Copy link

The main project page explains the supported compiler is "VS2017 and above".

Either target a later version of C++ or upgrade your IDE

@NickWaanders
Copy link
Contributor Author

Ah, you are correct.

I was looking at this page (which is linked from the main github page) https://bkaradzic.github.io/bgfx/overview.html which lists vs2015 under the supported compilers.

@bkaradzic
Copy link
Owner

bkaradzic commented Dec 6, 2018

I just need to update docs. VS2017 supports C++14 constexpr features I use.

One thing you can do is to remove constexpr from BX_CONSTEXPR_FUNC and it will compile with VS2015 or below.

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

4 participants