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

Compilation Error Involving StatusOr and Status Classes in Draco Library #1044

Closed
jianxiapyh opened this issue Jan 30, 2024 · 2 comments
Closed

Comments

@jianxiapyh
Copy link

Hi,

I am currently integrating the Draco library into our system and am facing a compilation error related to the StatusOr class. This issue arises when I include the "draco/io/ply_reader.h" in one of the header files.

Error Description:

The compilation error seems to be a type conversion issue involving the Status class. Here are the error messages:

usr/local/include/draco/core/status_or.h:38:30: error: no viable conversion from 'draco::Status' to 'int'
  StatusOr(const T &value) : status_(OkStatus()), value_(value) {}
                             ^       ~~~~~~~~~~
/usr/local/include/draco/core/status_or.h:39:25: error: no viable conversion from 'draco::Status' to 'int'
  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
                        ^       ~~~~~~~~~~
/usr/local/include/draco/core/status_or.h:53:35: error: member reference base type 'const int' is not a structure or union
  bool ok() const { return status_.ok(); }

Environment:

  • OS: Ubuntu 20.04
  • Compiler: Clang 10
  • Draco Version: Latest version from [specific branch or commit hash if applicable]

Current Workaround:

I have temporarily bypassed the problem by hardcoding certain values, but I am seeking a more robust and permanent solution.

Could you please provide some guidance on how to resolve this issue?

Thanks for your help!

@ondys
Copy link
Collaborator

ondys commented Jan 30, 2024

It may be that your code somewhere defines a macro similar to #define Status int . Can you try adding

#ifdef Status
#undef Status
#endif

before you include any Draco header?
You can also try to include the Draco header before you include any header of your project.

@jianxiapyh
Copy link
Author

Thank you, it seems I have code that defines Status earlier. Issue Closed.

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

2 participants