# Too restrictive for COFF OBJ files in \_\_create\_def

**URL:** https://discourse.cmake.org/t/too-restrictive-for-coff-obj-files-in-create-def/11077
**Category:** Usage
**Tags:** os:windows, gen:ninja
**Created:** [June 21, 2024, 4:29pm UTC](https://discourse.cmake.org/t/too-restrictive-for-coff-obj-files-in-create-def/11077 "2024-06-21T16:29:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![alkino](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/71c47a/32.png) [@alkino](https://discourse.cmake.org/u/alkino)
#### Post date: [June 21, 2024, 4:29pm UTC](https://discourse.cmake.org/t/too-restrictive-for-coff-obj-files-in-create-def/11077/1 "2024-06-21T16:29:45Z")

</div>

Hello,  
I’m trying to use cmake for windows, and automatically generate symbols files definitions.

We can see in the code that a COFF file id accepted as valid if `Characteristics` is equal to `0`, in my case this is not because I got the flag `IMAGE_FILE_LINE_NUMS_STRIPPED` by compiling with `gcc` (on windows yes).  
And so this is broken.  
The comment in the source code say `Characteristics == 0 indicating that this is not linked COFF OBJ file`, but it seems too much, right?

Here is the code:

> <https://github.com/Kitware/CMake/blob/d13afe720a9a255e81593dc125f76b465fd12265/Source/bindexplib.cxx#L448>

And here the documentation of the COFF header: [IMAGE\_FILE\_HEADER (winnt.h) - Win32 apps | Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_file_header)

Is it too restrictive?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [July 20, 2025, 11:51pm UTC](https://discourse.cmake.org/t/too-restrictive-for-coff-obj-files-in-create-def/11077/2 "2025-07-20T23:51:52Z")

</div>

It might be? Might require tracking down where the tool’s source code lives and see if there have been updates.

Cc: @brad.king
