2017年11月7日 星期二

[MFC]error LNK2001: unresolved external symbol __imp__GlobalMemoryStatusEx

Question:
S_USBPlugTestDlg.obj : error LNK2001: unresolved external symbol __imp__GlobalMemoryStatusEx@4
Dedug/3S_USBPlugTest.exe : fatal error LNK1120: 1 unresolved externals

[cid:image001.png@01D3587D.37DDB7B0]



Because:
too many versions of Kernel32.lib
[cid:image002.png@01D35880.07E4A700]


Solution:
1.Copy the correct version of lib ( from x86 folder) to source code
[cid:image003.png@01D35880.07E4A700]

2.Create Lib folder in souce code
[cid:image004.png@01D35880.655761C0]

3.add lib:
#pragma comment(lib, "Kernel32.lib")
[cid:image005.png@01D35880.7F4BAB40]


________________________________________ 3S CONFIDENTIALITY NOTICE: This message and all attachments may contain legally privileged and confidential information. Any unauthorized review, use or distribution by anyone other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately by replying to the message and delete all copies. Thank you.

沒有留言:

張貼留言