-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
conflicting typedef for int64 #7573
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I observed some tricks for similar problems in pure C:
|
Does OpenCV have a roadmap to eventually migrate to |
Same problem here. Would be really nice if OpenCV could stop bloating global namespace - at least in OpenCV3 where the C-API is considered deprecated (as as far as I know), it should be possible to move the the tdefs into the cv:: namespace. Or give it some prefix, I mean - come on, it's just a simple refactoring. |
i also encounter the same problem when using Dlib 19.17 with OpenCV 4.1.1 |
i also encounter the same problem when using SystemC 2.3.1-Accellera with OpenCV 4.1.1 systemc/include/sysc/datatypes/int/sc_nbdefs.h:182:36: note: previous declaration ‘typedef long long unsigned int sc_dt::uint64’ |
@Dinesh13197 : Did you find a solution to this problem? I am integrating OpenCV with SystemC and I am facing the same issue. The def/undef solution is really ugly . |
This int64 is used for two things in the code:
The following modifies my local sources so that it can compile with other libraries that define int64 (like SWIG). Not elegant ...
|
Hi did you find the solution for this? |
Almost 8 years later, and there is still no plan to do something about this issue? |
@mshabunin Could you take a look? |
I think we need to:
One thing which confuses me is that "(optional)" marker, it means that compiler/library may not define these types but I'm not aware of such cases. Links: |
@mshabunin , you can find an answer here https://stackoverflow.com/questions/32155759/state-of-support-for-the-optional-fixed-width-integer-types-introduced-in-c11 and especially here: https://cplusplus.github.io/LWG/issue2820 The types basically exist if the implementation guarantees they exist, which is what we want. |
Uh oh!
There was an error while loading. Please reload this page.
System information (version)
Detailed description
OpenCV has typedef in global namespace that will prevent compilation if other library has conflicting typedef. Currently, we are aware of one library (libgeos) that has conflicting typedef. We are going to submit similar bug report to libgeos.
I am aware that this problem could be solved by compiling code in different compilation unit, but currently we have shared code that can't be separated (or at least not easily) in different compilation units. The only option in that case is to either mess with typedef, i.e.:
or make wrapper interface and compile it different compilation units. Nevertheless, the nicest solution would be if opencv could stop using common typename like int64 in global namespace.
I am aware that using C++ namespace might not be option due to C interface, but at least prefixed typedef could be used, i.e. opencv_int64 / cv_int64 or similar. Such typedef would not break ABI, although it would change API.
We are ready to commit resources to this issue and provide a patch once we agree that this should be fixed and agree what is best approach to this issue.
Steps to reproduce
The text was updated successfully, but these errors were encountered: