Skip to content

conflicting byte definitions #7628

@oxillo

Description

@oxillo

When compiling examples from ofxIO, compilation errors appear :

C:/N/msys64/mingw64/include/rpcndr.h:64:11: error: reference to 'byte' is ambiguous
   64 |   typedef byte cs_byte;
      |           ^~~~
In file included from C:/N/msys64/mingw64/include/c++/13.2.0/bits/memory_resource.h:38,
                 from C:/N/msys64/mingw64/include/c++/13.2.0/string:58,
                 from C:/N/openframeworks/openFrameworks/libs/openFrameworks/utils/ofConstants.h:13,
                 from C:/N/openframeworks/openFrameworks/libs/openFrameworks/ofMain.h:6,
                 from C:/N/openframeworks/openFrameworks/addons/ofxIO/examples/json/example_json_utils/src/ofApp.h:11:
C:/N/msys64/mingw64/include/c++/13.2.0/cstddef:69:14: note: candidates are: 'enum class std::byte'
   69 |   enum class byte : unsigned char {};
      |              ^~~~
C:/N/msys64/mingw64/include/rpcndr.h:63:25: note:                 'typedef unsigned char byte'
   63 |   typedef unsigned char byte;

This is due to the using namespace std; in ofMain.h.
Removing the statement solves the problem.

temporary solution

replace "ofMain.h" by all needed include files

long term solution

To be discussed as just removing it can break existing codebase !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions