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

╄→гoц情女王★ 提交于 2019-12-12 08:48:35

问题


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

1>Linking... 1>.\bunny.obj : fatal error LNK1107: invalid or corrupt file: cannot read at 0x6592

I tried to search for similar errors, but there were about .dll's or .lib's.

Can you please help me out with this issue. I have also tried with different obj models but it always gives me this error.


回答1:


You are trying to load your object model with a C++ linker (probably you have just added it to the project, and now it tries to be compiled). The linker can process .obj files, but it waits them to be 'object-code' files (which also often have .obj extension), which are just compiled modules (e.g. written in C++ language) ready to be linked into a single executable or DLL.

Neither part of a C++ compiler is able to read graphical object model. You should remove the .obj file from your IDE project. And make sure you have a code that reads the file when the program runs.

If you want the object model to be embedded into your .EXE (so the program would not require the file in its directory), then you can put it into resources and link them with the executable.




回答2:


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

  1. Right click your .obj file.
  2. Click 'Properties
  3. Set 'Exclude from Build' to 'Yes'


来源:https://stackoverflow.com/questions/16373522/obj-fatal-error-lnk1107-invalid-or-corrupt-file-cannot-read-at-0x6592

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!