VC ++增量链接器错误LNK1000 [英] VC++ Incremental Linker Error LNK1000

查看:325
本文介绍了VC ++增量链接器错误LNK1000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明:我是一位C#专家,几乎没有VS C ++/MFC经验.

Disclaimer: I am a C# guy with virtually no VS C++/MFC experience.

我正在尝试在计算机上构建一些混合了C ++/.Net的项目.通过我的机器上的命令行编译C ++项目时,出现此错误:

I am trying to get some projects built on my machine that are mixed C++/.Net. When compiling a C++ project via the command line on my machine I am getting this error:

LINK:致命错误LNK1000:IMAGE :: BuildImage期间发生内部错误[SOURCE_CODE_PATH_TO_VCPROJ]

LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage [SOURCE_CODE_PATH_TO_VCPROJ]

我的Link.exe版本是:9.00.30729.1

My version of Link.exe is : 9.00.30729.1

触发此操作的代码行非常简单:

The line of code that is triggering this is pretty simple:

System :: String ^ fullPath = gcnew System :: String(dllpath);

System::String^ fullPath = gcnew System::String(dllpath);

当我抛弃gcnew东西并在其位置硬编码一个字符串时,一切都将正确编译.

When I ditch the gcnew stuff and just hardcode a string in its place everything compiles correctly.

对此进行大量搜索,发现很多帖子都说此问题已由VS2008 SP1中包含的kb948127解决.我已经验证我已安装了此特定的修补程序.我还验证了使用/INCREMENTAL:NO设置禁用了增量链接,但是每次编译我仍然遇到错误.

Googling this results in a lot of posts saying that this issue is fixed with kb948127 which is included in VS2008 SP1. I've verified that I have this particular hotfix installed. I've also verified that the incremental linking is disabled with the /INCREMENTAL:NO setting but I am still experiencing the error on every compile.

是否缺少我想要的设置或开关?以前有人遇到过这种问题吗?

Is there a setting or switch that I am missing? Has anyone run into this type of issue before?

推荐答案

我通过修改代码来使用marshal_as convert来创建System :: String ^,从而消除了链接器错误,但是我不清楚是什么从原始代码实际触发了链接器错误.

I've got the linker errors to go away by modifying the code to use marshal_as convert to create the System::String^ but I am not clear as to what actually triggered the linker error from the original code.

这是我换出的行:

System :: String ^ fullPath = marshal_as(dllPath);

System::String^ fullPath = marshal_as( dllPath );

这篇关于VC ++增量链接器错误LNK1000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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