Skip to content

error: redefinition of 'IsEqual' with Emscripten 3.1.11 #17031

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

Closed
donalffons opened this issue May 24, 2022 · 3 comments
Closed

error: redefinition of 'IsEqual' with Emscripten 3.1.11 #17031

donalffons opened this issue May 24, 2022 · 3 comments

Comments

@donalffons
Copy link

The problem was introduced by upgrading from the Emscripten Docker Image 3.1.10 to 3.1.11 (downgrading makes the error go away).

I'm getting these errors during compilation:

2022-05-24T09:45:10.4242458Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.4243046Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.4243403Z                         ^
2022-05-24T09:45:10.4243891Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.4244417Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.4244753Z                         ^
2022-05-24T09:45:10.4678365Z In file included from /opencascade.js/build/bindings/myMain.h/Instantiable1.cpp:4998:
2022-05-24T09:45:10.4679292Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.4679781Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.4680076Z                         ^
2022-05-24T09:45:10.4680516Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.4681005Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.4681294Z                         ^
2022-05-24T09:45:10.4710704Z In file included from /opencascade.js/build/bindings/myMain.h/ScopedEnum.cpp:4998:
2022-05-24T09:45:10.4711376Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.4711837Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.4712125Z                         ^
2022-05-24T09:45:10.4712573Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.4713186Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.4713483Z                         ^
2022-05-24T09:45:10.5342031Z In file included from /opencascade.js/build/bindings/myMain.h/TemplateClassInt.cpp:4998:
2022-05-24T09:45:10.5343738Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.5344282Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.5344606Z                         ^
2022-05-24T09:45:10.5345093Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.5345634Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.5345953Z                         ^
2022-05-24T09:45:10.5346446Z In file included from /opencascade.js/build/bindings/myMain.h/Instantiable2.cpp:4998:
2022-05-24T09:45:10.5347127Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.5347617Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.5347934Z                         ^
2022-05-24T09:45:10.5348421Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.5349028Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.5349690Z                         ^
2022-05-24T09:45:10.5350199Z In file included from /opencascade.js/build/bindings/myMain.h/Instantiable3.cpp:4998:
2022-05-24T09:45:10.5350905Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.5351404Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.5351705Z                         ^
2022-05-24T09:45:10.5352173Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.5352674Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.5352987Z                         ^
2022-05-24T09:45:10.5353501Z In file included from /opencascade.js/build/bindings/myMain.h/StaticMethods.cpp:4998:
2022-05-24T09:45:10.5354384Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.5354952Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.5355287Z                         ^
2022-05-24T09:45:10.5355820Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.5356427Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.5356782Z                         ^
2022-05-24T09:45:10.5357348Z In file included from /opencascade.js/build/bindings/myMain.h/NotScopedEnum.cpp:4998:
2022-05-24T09:45:10.5358161Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.5358719Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.5359182Z                         ^
2022-05-24T09:45:10.5359767Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.5360400Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,
2022-05-24T09:45:10.5360752Z                         ^
2022-05-24T09:45:10.6254882Z In file included from /opencascade.js/build/bindings/myMain.h/TemplateClassFloat.cpp:4998:
2022-05-24T09:45:10.6256000Z /occt/src/Standard/Standard_Time.hxx:29:25: error: redefinition of 'IsEqual'
2022-05-24T09:45:10.6256588Z inline Standard_Boolean IsEqual (const Standard_Time theOne,
2022-05-24T09:45:10.6256955Z                         ^
2022-05-24T09:45:10.6257498Z /occt/src/Standard/Standard_Integer.hxx:126:25: note: previous definition is here
2022-05-24T09:45:10.6258093Z inline Standard_Boolean IsEqual (const Standard_Integer theOne,

The first two errors refer to these files: Standard_Time.hxx and Standard_Integer.hxx. The seemingly conflicting types are Standard_Time and Standard_Integer.

This has compiled without problems in previous versions of Emscripten.

@kripken
Copy link
Member

kripken commented May 24, 2022

Probably best to bisect and see exactly where this regressed, as at least I don't have any idea from that error message:

https://emscripten.org/docs/contributing/developers_guide.html#bisecting

@sbc100
Copy link
Collaborator

sbc100 commented May 24, 2022

It seems most likely that this was the change of time_t from long to int: #16966

The reason we did this was so that time_t was the same size on wasm32 and wasm64. The problem I guess is that your code is assuming the int that time_t are not the same? Perhaps there is some way you can detect this avoid the duplication? The problem doesn't go away even if we revert this change since time_t would have to be the same as some basic type.

If decide that reverting to long is really the best idea we can do this.

@donalffons
Copy link
Author

Thank you for the explanation and yes, that seems to be the problem.

I guess is that your code is assuming the int that time_t are not the same? Perhaps there is some way you can detect this avoid the duplication?

I'm not maintaining that code (it's a dependency for me), but I will probably patch this temporarily and let the maintainers know. I believe a portable fix for this (i.e. not just pre-processor-checking for EMSCRIPTEN) would look like in this SO answer...

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