Sử dụng Visual Studio Express 2010 Tôi đã tạo một dự án Windows với các tùy chọn Ứng dụng Windows và Dự án trống. sau đó tôi thử following code snippet từ các hướng dẫn MSDN Windows:Các ký hiệu ngoài chưa được giải quyết __RTC_ * trong hướng dẫn lập trình Windows
#include <windows.h>
#include <shobjidl.h>
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow)
{
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED |
COINIT_DISABLE_OLE1DDE);
if (SUCCEEDED(hr))
{
IFileOpenDialog *pFileOpen;
// Create the FileOpenDialog object.
hr = CoCreateInstance(CLSID_FileOpenDialog, NULL, CLSCTX_ALL,
IID_IFileOpenDialog, reinterpret_cast<void**>(&pFileOpen));
if (SUCCEEDED(hr))
{
// Show the Open dialog box.
hr = pFileOpen->Show(NULL);
// Get the file name from the dialog box.
if (SUCCEEDED(hr))
{
IShellItem *pItem;
hr = pFileOpen->GetResult(&pItem);
if (SUCCEEDED(hr))
{
PWSTR pszFilePath;
hr = pItem->GetDisplayName(SIGDN_FILESYSPATH, &pszFilePath);
// Display the file name to the user.
if (SUCCEEDED(hr))
{
MessageBox(NULL, pszFilePath, L"File Path", MB_OK);
CoTaskMemFree(pszFilePath);
}
pItem->Release();
}
}
pFileOpen->Release();
}
CoUninitialize();
}
return 0;
}
tôi bị các lỗi sau đây:
1>------ Rebuild All started: Project: Test05, Configuration: Debug Win32 ------
1> Test05.cpp
1>Test05.obj : error LNK2019: unresolved external symbol @[email protected]
referenced in function [email protected]
1>Test05.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in
function [email protected]
1>Test05.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
1>Test05.obj : error LNK2001: unresolved external symbol __RTC_InitBase
1>LINK : error LNK2001: unresolved external symbol _wWinMainCRTStartup
gì đang xảy ra ở đây? Tốt nhất tôi có thể nói điều gì đó để làm với wWinMain
, nhưng nó được sao chép trực tiếp từ trang web.
Trình biên dịch dường như còn gây rắc rối cho tôi nhiều hơn là lập trình học. Tôi quyết định trên Visual C++ sau khi thử một vài người khác (codeblocks chủ yếu), nhưng kể từ khi Visual C++ dường như có sự hỗ trợ nhiều nhất (hoặc ít nhất là đa số người dùng) tôi đã tìm thấy nó tốt hơn không bao giờ nhận được bất cứ nơi nào vì họ tất cả đều không trực quan một người mới bắt đầu.
Bạn có thể giải quyết được không? –