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

Build fails on clang 3.9, 4 & 5 (not 6) #544

Closed
helmesjo opened this issue Aug 20, 2018 · 4 comments
Closed

Build fails on clang 3.9, 4 & 5 (not 6) #544

helmesjo opened this issue Aug 20, 2018 · 4 comments

Comments

@helmesjo
Copy link

helmesjo commented Aug 20, 2018

I've created a conan package for aeron. It fails when building with clang (except version 6) with the following error:

aeron-client/src/main/cpp/util/MemoryMappedFile.h:42:50: error: unknown type name 'off_t'
    static ptr_t createNew(const char* filename, off_t offset, size_t length)

PR #315 changed usages of size_t to off_t. Was this really necessary to make it compile for windows?

Any suggestions for a workaround?

@tmontgomery
Copy link
Contributor

Awesome that you've got a conan package for Aeron! Thanks!

Changing to off_t was done more for cleaning up. Don't think it is used for win32 build. off_t is a normal type, though, to have for Linux (and most POSIX) anyway. So, that is quite odd that it isn't finding the type. Could this be an include issue (or some sort of compat flag issue?)

@helmesjo
Copy link
Author

You're welcome! :)

Yeah, off_t is apparently found in <sys/types.h>. That header is included in MemoryMappedFile.cpp, but should perhaps then have been included in MemoryMappedFile.h instead, before declaring the class.

Here are the settings & options passed to conan when building the package:

+------------------------+
| Profile                |
|------------------------|
| include(default)       |
|                        |
| [settings]             |
| arch=x86               |
| build_type=Release     |
| compiler=clang         |
| compiler.libcxx=libc++ |
| compiler.version=3.9   |
| [options]              |
| aeron:shared=True      |
| [env]                  |
|                        |
| [build_requires]       |
+------------------------+

@mjpt777
Copy link
Contributor

mjpt777 commented Aug 27, 2018

@tmontgomery how do you feel about moving to a convention that each file can compile on its own with dependencies? If a header has dependencies it includes them. This should address such issues.

@tmontgomery
Copy link
Contributor

We have this somewhat in the C driver. But, yes, some includes should be moved to the headers in the C++ API.

helmesjo added a commit to helmesjo/aeron that referenced this issue Aug 29, 2018
…pedFile.h to include type 'off_t' before usage.

Fixes real-logic#544
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