main.obj : fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x6

谁都会走 提交于 2019-12-24 09:14:06

问题


I am on a Windows 10 machine, I have 2 files, main.cpp and cuda.cu (I have built this project on Ubuntu successfully I am trying to get it to build on Windows). I compiled both of them to make object files of 64 bit architecture. I have MS Visual Studio 2010 currently installed and I know it is too old. I can install 2015 if you think that is causing this (but I don't think so).

When I try to link the two files using the command

nvcc main.obj cuda.obj

I get this error:-

main.obj : fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x6

What should I do?


回答1:


As pointed out by @RichardCritten,

the files should be compiled with MSVC as the object formats are tool-chain specific. LNK1143 is from the MS linker and it can't understand the format of the obj files produced by the other tool-chain.

So object files created by MinGW's g++ can't be linked with a cuda program's object file with MSVC



来源:https://stackoverflow.com/questions/50951036/main-obj-fatal-error-lnk1143-invalid-or-corrupt-file-no-symbol-for-comdat-se

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