main.obj:致命错误LNK1143:文件无效或损坏:COMDAT部分0x6没有符号 [英] main.obj : fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x6

查看:982
本文介绍了main.obj:致命错误LNK1143:文件无效或损坏:COMDAT部分0x6没有符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10机器上,我有2个文件,main.cpp和cuda.cu(我已经在Ubuntu上成功构建了这个项目,我试图使其在Windows上构建)。我将它们都编译为64位体系结构的目标文件。我当前安装了MS Visual Studio 2010,我知道它太旧了。如果您认为是造成此问题的原因,则可以安装2015。(我不这么认为。)

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

我得到这个错误:-

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

我该怎么办?

推荐答案

@RichardCritten指出,

As pointed out by @RichardCritten,


文件应使用MSVC作为对象格式是
工具链特定的。 LNK1143来自MS链接器,它
无法理解其他
工具链生成的obj文件的格式。

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.

因此,MinGW的g ++创建的目标文件无法通过MSVC与cuda程序的目标文件链接

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

这篇关于main.obj:致命错误LNK1143:文件无效或损坏:COMDAT部分0x6没有符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆