在x64中构建遗留代码 [英] Legacy code building in x64

查看:62
本文介绍了在x64中构建遗留代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在Visual Studio 2008 for x64中构建遗留代码。当我建设时,我遇到了一个我必须建立一个图书馆的情况。它是一个库项目,有一个类和一个包含10-15个函数的文件。当库是用32位版本构建的,即WIN32一切都很好。但是当它在x64中构建时,类中的函数将被导出,而文件中的函数不会被导出。任何人都可以给我一些可能出错的线索。



提前致谢

AJAI



我尝试过:



i使用dumpbin确认正在导出c ++类函数。在同一个我看不到导出的其他文件中的任何函数。

I have been trying to build a legacy code in Visual Studio 2008 for x64. When i am building i met with a situation where i have to build a library. It is a library project and in that there is a class as well as a file with some 10 -15 functions. When the library is built in 32 bit version, i.e WIN32 everything is fine. But when it is built in x64, the functions from the class is getting exported where as the function from the file is not getting exported. Can anyone give me a clue on what could be wrong.

Thanks in Advance
AJAI

What I have tried:

i used the dumpbin to confirm the c++ class functions are being exported. In the same i couldn't see any of the functions from the other file being exported.

推荐答案

您必须深入了解这些类的代码。我猜有一些保护宏可以激活win32导出,这些宏未在x64设置中定义。

例如WIN3​​2未定义,但有些WIN64。这很棘手:看看编译器的项目设置。



提示:使用Visual Studio 2010它有更好的x64支持。我用* 2010重命名项目文件,以获得VS 2010的副本和VS 2008的备份。
You must take a deep look in the code of these classes. I guess that there are some guarding macros which activate the win32 export which arent defined in the x64 settings.
For instance WIN32 isnt defined, but some WIN64. It is tricky: take also a look in the project settings of the compiler.

Tip: use Visual Studio 2010 it has better x64 support. I rename the project file with *2010 to have a copy for VS 2010 and the backup for VS 2008.


规则完全相同,无论是32位还是64位;请参阅创建和使用动态链接库(C ++) [ ^ ]。检查项目设置,看是否正确标记了要导出的不同功能。
The rules are exactly the same whether it is 32 or 64 bit; see Creating and Using a Dynamic Link Library (C++)[^]. Check your project settings to see that you are correctly marking the different functions for export.


这篇关于在x64中构建遗留代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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