Я попробовал приложение Compile win32 с Mingw-W64.
, но оно повышает ошибку
undefined reference to __imp_CoCreateInstance' on mingw-w64< /code> < /code>. < /p>
My Mingw-w64, установленная в каталоге C: \ mingw64.
и заданные параметры для компиляции.g++ -L C:\mingw64\x86_64-w64-mingw32\lib -lole32 hello.cpp -o hello
< /code>
Как я могу исправить эту ошибку?#include
#include
#include
#include
#include
#include
#include
#include
HRESULT InitializeUIAutomation(IUIAutomation **ppAutomation)
{
return CoCreateInstance(CLSID_CUIAutomation, NULL,
CLSCTX_INPROC_SERVER, IID_IUIAutomation,
reinterpret_cast(ppAutomation));
}
void show_error(HRESULT hr)
{
if (hr != S_OK)
{
std::string s = std::system_category().message(hr);
const char *err = s.c_str();
printf("%s\n", err);
}
}
int main()
{
printf("Hello world from windows2\n");
IUIAutomation **ppAutomation;
IUIAutomation *pAutomation;
IUIAutomationElement *root;
IUIAutomationElement *start_button;
IUIAutomationElement3 *start_button3;
IUIAutomationCondition *start_button_cond;
VARIANT start_button_v;
wchar_t *start_button_autoid = L"StartButton";
InitializeUIAutomation(ppAutomation);
pAutomation = *ppAutomation;
HRESULT hr = pAutomation->GetRootElement(&root);
show_error(hr);
start_button_v.vt = VT_BSTR;
start_button_v.bstrVal = start_button_autoid;
pAutomation->CreatePropertyCondition(UIA_AutomationIdPropertyId, start_button_v, &start_button_cond);
hr = root->FindFirst(TreeScope_Descendants, start_button_cond, &start_button);
show_error(hr);
start_button3 = reinterpret_cast(start_button);
start_button3->ShowContextMenu();
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... -mingw-w64
Неопределенная ссылка на `__imp_cocreateinstance 'на Mingw-W64 [дублировать] ⇐ C++
Программы на C++. Форум разработчиков
1759154505
Anonymous
Я попробовал приложение Compile win32 с Mingw-W64.
, но оно повышает ошибку
undefined reference to __imp_CoCreateInstance' on mingw-w64< /code> < /code>. < /p>
My Mingw-w64, установленная в каталоге C: \ mingw64.
и заданные параметры для компиляции.g++ -L C:\mingw64\x86_64-w64-mingw32\lib -lole32 hello.cpp -o hello
< /code>
Как я могу исправить эту ошибку?#include
#include
#include
#include
#include
#include
#include
#include
HRESULT InitializeUIAutomation(IUIAutomation **ppAutomation)
{
return CoCreateInstance(CLSID_CUIAutomation, NULL,
CLSCTX_INPROC_SERVER, IID_IUIAutomation,
reinterpret_cast(ppAutomation));
}
void show_error(HRESULT hr)
{
if (hr != S_OK)
{
std::string s = std::system_category().message(hr);
const char *err = s.c_str();
printf("%s\n", err);
}
}
int main()
{
printf("Hello world from windows2\n");
IUIAutomation **ppAutomation;
IUIAutomation *pAutomation;
IUIAutomationElement *root;
IUIAutomationElement *start_button;
IUIAutomationElement3 *start_button3;
IUIAutomationCondition *start_button_cond;
VARIANT start_button_v;
wchar_t *start_button_autoid = L"StartButton";
InitializeUIAutomation(ppAutomation);
pAutomation = *ppAutomation;
HRESULT hr = pAutomation->GetRootElement(&root);
show_error(hr);
start_button_v.vt = VT_BSTR;
start_button_v.bstrVal = start_button_autoid;
pAutomation->CreatePropertyCondition(UIA_AutomationIdPropertyId, start_button_v, &start_button_cond);
hr = root->FindFirst(TreeScope_Descendants, start_button_cond, &start_button);
show_error(hr);
start_button3 = reinterpret_cast(start_button);
start_button3->ShowContextMenu();
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79778188/undefined-reference-to-imp-cocreateinstance-on-mingw-w64[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия