X64移植编译常见问题

X64常见问题:

 

1.编译exe文件,libcmt.lib(wincrt0.obj) : error LNK2019: 无法解析的外部符号WinMain,该符号在函数__tmainCRTStartup 中被引用

通常是因为链接的库不对,在项目配置中,找到常规配置,其中有关于MFC的使用,选择“在共享DLL中使用MFC”或者“在静态库中使用MFC

 

2.无法链接

__cdecl

查看动态库C/C++的配置,高级,调用约定是否为__cdecl

 

3.修改成UNICODElibcmtd.lib(wincrt0.obj) : error LNK2001: 无法解析的外部符号_WinMain@16

Project->Settings->Link选项下选择Output, 然后在Entry里输入:wWinMainCRTStartup即可

 

修改后

./res/APPd.exe.manifest : generalerror c1010070: Failed to load and parse the manifest. {_~0p'1a@'7v _

 

最终解决方案,打开./res/Appd.exe.manifest,如果没有这个文件,请注意浏览器是否是不显示隐藏文件。打开该文件,一般这个文件前后部分都有乱码,中间部分是xml格式。删除前后的乱码。

一切编译正常了。

 

 

The core problem is that Visual Studiois being asked to incorporate a manifest file but it cannot seem to find it.

 

From research the problem appears tostem from a possible number of sources, most related to the project itself.Some potential causes:

 

1) Numbers or spaces in the project name

2) Project name too long

3) Started creating the project from ablank project that doesn't have all of the parts.

 

I'd suggest trying each of the followingto see if it fixes the issue- but backup your project/solution directory first.

 

A) Clean and rebuild the solution

 

B) Right click on the solution for theproject (in Solution Explorer) and rename the solution to a very simple name(e.g., soln). Then do the same for the project (e.g., rename to proj). Do arebuild all and see if the problem goes away. If it does you can rename thesolution and project to something more meaningful.

 

C) Right click on the project and openit's properties. Go To Link | Manifest and turn off use of the manifest.Rebuild.

 

D) Create a new Win32 console project.Have Visual Studio create the initial CPP and .H files you need. Open your oldsource files and copy the code from those into the new files. Rebuild the newproject.

 

 

 

4.win32程序在x64机器上,代码空间和win32操作系统上是相同的。所以做代码注入的时候需要和win32相同。包括跳转地址在内都是32位。

 

5.需要链接的动态库的.lib已经指定,但是编译时候仍然提示找不到void __cdecl fuctionw之类的信息。

编译动态库的时候没有指定.def文件,可能会导致这个问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值