我对 C++ 不是很精通,并且遇到了一个我不太确定如何解决的链接问题。我有一个在 x64 模式下构建良好的解决方案,但在 x86 模式下会出现链接错误。
我已经确认该项目配置为构建为 Win32,并且平台工具集设置为 v90。
错误前链接器日志的最后几行如下:
...
1> Found "long __stdcall AfxDllCanUnloadNow(void)" (?AfxDllCanUnloadNow@@YGJXZ)
1> Referenced in mfcs90.lib(oleexp.obj)
1> Loaded mfc90.lib(mfc90.dll)
1> Found "public: __thiscall CDynLinkLibrary::CDynLinkLibrary(struct HINSTANCE__ *,struct HINSTANCE__ *)" (??0CDynLinkLibrary@@QAE@PAUHINSTANCE__@@0@Z)
1> Referenced in mfcs90.lib(dllmodulx.obj)
1> Loaded mfc90.lib(mfc90.dll)
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\lib\mfcs90.lib:
1> Found __pRawDllMain
1> Referenced in msvcrt.lib(crtdll.obj)
1> Loaded mfcs90.lib(rawdllmainproxy.obj)
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\msvcrt.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\kernel32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\user32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\gdi32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\msimg32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\comdlg32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\winspool.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\advapi32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\shell32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\comctl32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\shlwapi.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\msvcprt.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\mapi32.lib:
1> Searching C:\Program Files\Microsoft SDKs\Windows\v7.0\lib\Ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\lib\atls.lib:
1>
1> Finished searching libraries
1>
1> Generating .exp file
1>LINK : error LNK2001: unresolved external symbol Install
1>Release\app.lib : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
有没有人知道我做错了什么。我发现了许多类似的问题,但解决方案似乎并不适用。对不起这么简单的问题。