.obj: fatal error LNK1107: invalid or corrupt file: cannot read on 0x6592

I am trying to load the .obj model into my C ++ opengl 3 code, but for some reason it gives me this error:

1> Communication ... 1>. \ Bunny.obj: fatal error LNK1107: invalid or corrupt file: cannot read 0x6592

I tried to find similar errors, but there were .dll or .lib.

Could you help me solve this problem. I also tried using different obj models, but it always gives me this error.

+6
source share
2 answers

You are trying to load your object model using the C ++ linker (you may have just added it to the project, and now it is trying to compile). The compiler can process .obj files, but it waits for them to be object-code files (which also often have the .obj extension), which are only compiled modules (for example, written in C ++), ready to be connected to one executable file or dll.

No part of the C ++ compiler can read a graphical object model. You must remove the .obj file from the IDE project. And make sure that you have code that reads the file when the program starts.

If you want the object model to be embedded in your .EXE (so the program does not need a file in its directory), you can put it in resources and associate them with an executable file.

+7
source

I had the same problem and resolved it by excluding the .obj file from the assembly. In other words:

  • Right-click your .obj file.
  • Click Properties
  • Set Exclude From Assembly To Yes
+1
source

Source: https://habr.com/ru/post/944274/


All Articles