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

HashCode() and IsEqual() redifinitions (Standard_Size.hxx & Standard_Integer.hxx) #478

Closed
8bit-Dude opened this issue Feb 19, 2014 · 13 comments

Comments

@8bit-Dude
Copy link

I am trying to compile GEOM and SMESH in windows, using the Headers from OCE.

I have tried with both MinGW and MSVC10, and I get error messages in both saying that HashCode() and IsEqual() are redefined (in Standard_Size.hxx & Standard_Integer.hxx).

Very strangely, I encountered no such issue when compiling OCE itself!
Has anyone got a helpful pointer for me?

@dbarbier
Copy link
Collaborator

Indeed, you have to pass -DHAVE_CONFIG_H flag to your compiler, this is a bug in OCE.

@8bit-Dude
Copy link
Author

Wow, that was quick!!!
Merci Denis!

@8bit-Dude
Copy link
Author

Hmmm.... still getting the same error message.
I added the following lines to CMakeLists.txt:

SET(GCC_COMPILE_FLAGS "-DHAVE_CONFIG_H")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COMPILE_FLAGS}" )

I have also double checked that the flag is correctly passed to g++.
Any other clues?

@8bit-Dude
Copy link
Author

I added this line in Standard_Integer.hxx to make the problem go away:
#define OCE_IS_DUPLICATE_UINT32_T

@dbarbier
Copy link
Collaborator

I do not understand why -DHAVE_CONFIG_H did not fix your issue. Is your oce-config.h file empty? Does it define OCE_IS_DUPLICATE_UINT32_T?

@8bit-Dude
Copy link
Author

It only contains 3 lines of comment (source: tarball for OCE 0.14.1):

// This is an empty header file which is a placeholder
// when compiling without CMake, and is not used when
// compiling with CMake

@dbarbier
Copy link
Collaborator

And how did you build OCE? It looks like you did not use CMake.

@8bit-Dude
Copy link
Author

I am using CMake together with MinGW.

@dbarbier
Copy link
Collaborator

This is weird. I see two reasons why this may happen:

  1. You pass -I<srcdir>/inc flag
  2. There is a bug in OCE or CMake; currently, we first copy <srcdir>/inc/oce-config.h, and after that, <builddir>/build_inc/oce-config.h overwrites it.

Can you please check that <srcdir>/inc is not in your include path? If so, I will fix 2.

@8bit-Dude
Copy link
Author

Aaaaaah, I understand the problem!!!
The oce-config.h in OCE's /build_inc/ looks correct (generated by CMake when building OCE).
But... my SMESH and GEOM OCE_INCLUDE_PATH points to OCE/inc/
So it never sees the correct oce-config.h file.

@dbarbier
Copy link
Collaborator

Okay, but this is still not fully clear; since OCE 0.13, some header files have been moved away from inc/, in particular the ones mentioned on the bug title.
Do you use OCE_COPY_HEADERS_BUILD option? Maybe we should copy build_inc/oce-config.h (or better yet install_inc/oce-config.h) when this option is set.

@dbarbier
Copy link
Collaborator

A simpler option is to modify adm/cmake/BuildToolkit.cmake to copy files into <builddir>/install_inc instead of <builddir>/include.

@dbarbier
Copy link
Collaborator

Hello, I believe that this issue has been fixed, please reopen if you still have trouble.

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