本文介绍了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,

因此,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没有符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 09:46
查看更多