# Annotating a module as C-only?

**URL:** <https://forums.swift.org/t/annotating-a-module-as-c-only/67508>\
**Category:** C++ interoperability\
**Created:** [September 25, 2023, 8:50pm UTC](https://forums.swift.org/t/annotating-a-module-as-c-only/67508 "2023-09-25T20:50:24Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Alex\_L](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/alex_l/32/6202_2.png) [@Alex\_L](https://forums.swift.org/u/Alex_L)\
**Post date:** [September 26, 2023, 5:36pm UTC](https://forums.swift.org/t/annotating-a-module-as-c-only/67508/5 "2023-09-26T17:36:05Z")

</div>

Package A does not need to have interoperability enabled, but the main package must have C++ interoperability enabled to be able to use B, as using C++ interoperability is viral. Once main enables C++ interoperability, the C-based dependencies of A will be imported in C++ mode as well as Main needs to import A, and thus transitively it needs to import C-based dependencies of A. Basically, when you're building A by itself, the headers that A imports do not need to support C++, however, once you start importing A into Main, then the headers that A imports must support C++ as well.

---

_[View the full topic](https://forums.swift.org/t/annotating-a-module-as-c-only/67508)._
