[llvm-bugs] [Bug 32192] New: [modules] name clashes with non-included libraries
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 9 06:28:11 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=32192
Bug ID: 32192
Summary: [modules] name clashes with non-included libraries
Product: clang
Version: trunk
Hardware: Macintosh
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Modules
Assignee: unassignedclangbugs at nondot.org
Reporter: gonzalobg88 at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
I am trying to compile a binary that uses range-v3 as a library, using
-fmodules with implicit modules enabled and my own module.modulemap file for my
code.
Under MacOSX the following directory is in my include path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/
because I want to use the POSIX headers.
That directory has a module.modulemap file that defines an ncurses modules
which included the curses.h header.
The problem:
- ncurses exports a type named meta
- range-v3 has a namespace named meta
Both clash, even though I am not including the ncurses.h headers anywhere.
If I opt-out of implicit modules and define my own module.modulemap files, I
can compile my code fine, but I don't get to reuse any of the definitions in
the /Applications/..../SDK/include/module.modulemap above for the libraries I
actually want to use (like the posix headers).
What's the correct way to solve this issue?
Why is clang importing the ncurses library if none of my code is including it?
In particular, the error message I get is:
While building module 'hm3_utility_mpi' imported from
/Users/gnzlbg/projects/hm3/test/hm3/utility/mpi.cpp:4:
While building module 'hm3_utility_mpi_comm' imported from
/Users/gnzlbg/projects/hm3/include/hm3/utility/mpi.hpp:6:
While building module 'hm3_utility_fmt' imported from
/Users/gnzlbg/projects/hm3/include/hm3/utility/mpi/comm.hpp:5:
While building module 'hm3_utility_ref' imported from
/Users/gnzlbg/projects/hm3/include/hm3/utility/fmt.hpp:6:
While building module 'hm3_utility_range' imported from
/Users/gnzlbg/projects/hm3/include/hm3/utility/ref.hpp:5:
While building module 'hm3_ext_range_v3' imported from
/Users/gnzlbg/projects/hm3/include/hm3/utility/range.hpp:6:
In file included from <module-includes>:1:
In file included from
/Users/gnzlbg/projects/hm3/include/hm3/ext/range-v3.hpp:16:
In file included from
/Users/gnzlbg/projects/hm3/modules_build/src/range-v3/include/range/v3/all.hpp:17:
In file included from
/Users/gnzlbg/projects/hm3/modules_build/src/range-v3/include/range/v3/core.hpp:17:
In file included from
/Users/gnzlbg/projects/hm3/modules_build/src/range-v3/include/range/v3/begin_end.hpp:21:
In file included from
/Users/gnzlbg/projects/hm3/modules_build/src/range-v3/include/range/v3/range_fwd.hpp:20:
In file included from
/Users/gnzlbg/projects/hm3/modules_build/src/range-v3/include/meta/meta.hpp:20:
/Users/gnzlbg/projects/hm3/modules_build/src/range-v3/include/meta/meta_fwd.hpp:36:11:
error: redefinition of 'meta' as different kind of symbol
namespace meta
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/curses.h:603:28:
note: previous definition is here
extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /*
implemented */
But the error does not pinpoint any location that includes the curses.h header.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170309/16911e41/attachment.html>
More information about the llvm-bugs
mailing list