embed icon indicating copy to clipboard operation
embed copied to clipboard

LNK1107 with MSVC when embedding 3d models with obj extension

Open itsdanott opened this issue 10 months ago • 0 comments

Description

When embedding files with the obj extension (3d models) and compiling with MSVC the build will fail with

fatal error LNK1107: invalid or corrupt file: cannot read at 0x6C8C

I assume this is due to the obj suffix being interpreted as C/C++ obj.

The generated file path looks like this

embed\autogen\embedded\src\embedded_file_name_obj.cpp.obj

How to reproduce

  1. Embed any obj file
  2. Compile with MSVC
  3. Notice build failing with LNK1107

Workaround & Other Compilers

Workaround for now is to change the extension to something else - but of course this can get annoying when re-exporting out of 3d software.

Compilation with MinGW / GCC works without any issues.

itsdanott avatar Apr 09 '25 21:04 itsdanott