LNK1112错误:在x64配置中使用x86库

编程入门 行业动态 更新时间:2024-10-28 21:30:17
本文介绍了LNK1112错误:在x64配置中使用x86库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个用x86配置创建的库文件,遗憾的是,我没有它的项目文件。现在,我需要在另一个具有x64配置的项目中使用该库文件(在x86中制作)。有没有办法我可以将该库文件转换为 x64而没有原始项目文件?

我注意到其他论坛/线程讨论IPC机制(我无法跟随)。感谢是否有人帮我解决了这个问题。

提前致谢。

解决方案

您不能在64位进程中直接使用32位库。如果不使用64位编译器重新编译它,就不能将32位库转换为64位。正如您所注意到的,IPC是您可以用来完成工作的唯一机制。

首先创建一个使用32位库的32位EXE。基本上你有一个64位的EXE和一个32位的EXE,它们必须相互通信。

对于IPC,你可以在Windows上使用几种机制,如消息传递,文件映射,套接字, RPC等。

在此处阅读 - 进程间通信

在列出的方法中,套接字或管道最容易实现

I have a library file that was created with x86 configuration and unfortunately, i do not have its project file. Now, I need to use that library file (made in x86) in another project with x64 configuration. Is there way I can convert that library file to x64 with out having its original project file?

I notice from other forums/threads discussing about IPC mechanism (which I am unable to follow). Appreciate if someone helps me to resolve this issue.

Thanks in advance.

解决方案

You cannot directly use a 32-bit library in a 64-bit process. Not can you convert a 32-bit library to 64-bit without recompiling it with a 64-bit compiler. As you correctly noticed, IPC is the only mechanism you can use to get your job done.

First create a 32-bit EXE that uses the 32-bit library. Basically you have a 64-bit EXE and a 32-bit EXE which must communicate with each other.

For IPC, you can use several mechanisms on Windows like Messaging, File Mapping, Sockets, RPC etc.

Read about it here -InterProcess Communication

Among the listed methods, sockets or pipes would be the easiest to implement.

更多推荐

LNK1112错误:在x64配置中使用x86库

本文发布于:2023-11-15 21:47:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1598242.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!