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 failing - Missing include in configuration.h #370

Closed
JoeRosselli opened this issue Feb 10, 2024 · 3 comments
Closed

Build failing - Missing include in configuration.h #370

JoeRosselli opened this issue Feb 10, 2024 · 3 comments
Assignees
Labels

Comments

@JoeRosselli
Copy link

Hi,

The Problem

The project fails to build for me on Ubuntu 23.10 using GCC 13.2.0 and CMake 3.27.4.

I'm doing a basic git check out, cmake, then make flow.

Sample error message:

/{redacted}/reactphysics3d/include/reactphysics3d/configuration.h:69:19: error: ‘int8_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?

When attempting to build it outputs hundreds/thousands of errors related to this.

The Cause/Fix

The root problem seems to be because configuration.h references various standard library type definitions (std::int8_t, std::uint8_t, etc.,) but doesn't include the header they're defined in.

All of those type definitions are defined in cstdint, and so configuration.h should be modified to include this header (https://en.cppreference.com/w/cpp/header/cstdint)

I tested locally modifying the header to include cstdint with the other system headers and all errors went away and the project built successfully without issue.

Here are the problematic lines:

using int8 = std::int8_t;
using uint8 = std::uint8_t;
using int16 = std::int16_t;
using uint16 = std::uint16_t;
using int32 = std::int32_t;
using uint32 = std::uint32_t;
using int64 = std::int64_t;
using uint64 = std::uint64_t;

Thanks!

@JoeRosselli
Copy link
Author

I should probably also note that I'm building with cxx_std_23 compiler feature enabled.

The build failure is likely a combination of compiler + c++ version, where the latest c++ standard/compiler no longer erroneously exposes the type definitions from other system headers and now cstdint is required to be included.

@DanielChappuis
Copy link
Owner

Thanks for reporting this issue. This has been fixed and merged into the 'develop' branch in the this pull request. This fix will be available in the next release of the library.

@DanielChappuis DanielChappuis self-assigned this Feb 13, 2024
@DanielChappuis DanielChappuis added this to the Release v1.0.0 milestone Feb 13, 2024
@DanielChappuis
Copy link
Owner

This is now fixed in version v0.10.0 of the library. Thanks a lot for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants