C / C ++ WIN32 — Gecko — встроенный веб-браузер

Я создал приложение WIN32 для C / C ++ в Visual Studio. Затем я пошел по следующему адресу, чтобы загрузить пример использования Gecko: https://github.com/bnoordhuis/mozilla-central/tree/master/embedding/tests/winEmbed .

Итак, я скопировал все * .cpp, * h, * .rc в моем проекте. Затем я скомпилировал приложение. Но я получил более 150 ошибок из-за ошибок зависимостей и т. Д. Итак, я скачал sdk xulrunner-41.0.2.en-us.win32.sdk.zip. Я распаковал файл. В свойствах моего проекта (C / C ++ >> Общие >> Дополнительные каталоги включения) я добавил следующие строки:

$(ProjectDir);
$(ProjectDir)sdk\xulrunner-41.0.2.en-US.win32.sdk\xulrunner-sdk\include;
$(ProjectDir)sdk\xulrunner-41.0.2.en-US.win32.sdk\xulrunner-sdk\idl;
$(ProjectDir)sdk\xulrunner-41.0.2.en-US.win32.sdk\xulrunner-sdk\include\nspr\;
$(ProjectDir)sdk\xulrunner-41.0.2.en-US.win32.sdk\xulrunner-sdk\lib

Но у меня все еще есть 45 ошибок. Это сводит меня с ума.

Это ошибки:

Error (active)                     identifier "XRE_InitEmbedding2Type" is undefined         WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             49

Error (active)                     identifier "XRE_TermEmbeddingType" is undefined       WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             50

Error (active)                     argument of type "char *" is incompatible with parameter of type "LPWSTR"     WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             171

Error (active)                     identifier "XPCOMGlueStartup" is undefined     WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             178

Error (active)                     argument of type "char *" is incompatible with parameter of type "LPCWSTR"   WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             184

Error (active)                     identifier "XRE_InitEmbedding2Type" is undefined         WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             189

Error (active)                     expected a ';'     WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             189

Error (active)                     identifier "XRE_TermEmbeddingType" is undefined       WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             196

Error (active)                     expected a ';'     WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             196

Error (active)                     no suitable conversion function from "nsGetterAddRefs<nsILocalFile>" to "nsIFile **" exists                WinEmbed         c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             208

Error (active)                     no suitable conversion function from "nsGetterAddRefs<nsILocalFile>" to "nsIFile **" exists                WinEmbed         c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             216

Error (active)                     a value of type "PRUint32" cannot be assigned to an entity of type "nsresult"    WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             239

Error (active)                     return value type does not match the function type       WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             244

Error (active)                     no instance of constructor "NS_ConvertASCIItoUTF16_external::NS_ConvertASCIItoUTF16_external" matches the argument list      WinEmbed                c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             535

Error (active)                     argument of type "const nsACString::char_type *" is incompatible with parameter of type "LPCWSTR"        WinEmbed         c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             925

Error (active)                     argument of type "const nsACString::char_type *" is incompatible with parameter of type "LPCWSTR"        WinEmbed         c:\Users\p4481680\Documents\WinEmbed\WinEmbed\WinEmbed.cpp             948

Error      C1010    unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?         WinEmbed                c:\users\p4481680\documents\winembed\winembed\windowcreator.cpp        54

Error      C4430    missing type specifier - int assumed. Note: C++ does not support default-int      WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 49

Error      C4430    missing type specifier - int assumed. Note: C++ does not support default-int      WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 50

Error      C2146    syntax error: missing ';' before identifier 'XRE_InitEmbedding2' WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 49

Error      C2146    syntax error: missing ';' before identifier 'XRE_TermEmbedding'               WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 50

Error      C2664    'DWORD GetModuleFileNameW(HMODULE,LPWSTR,DWORD)': cannot convert argument 2 from 'char [260]' to 'LPWSTR'           WinEmbed         c:\users\p4481680\documents\winembed\winembed\winembed.cpp 171

Error      C3861    'XPCOMGlueStartup': identifier not found           WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 178

Error      C2664    'HMODULE LoadLibraryExW(LPCWSTR,HANDLE,DWORD)': cannot convert argument 1 from 'char [260]' to 'LPCWSTR'        WinEmbed         c:\users\p4481680\documents\winembed\winembed\winembed.cpp 184

Error      C2659    '=': function as left operand        WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 189

Error      C2146    syntax error: missing ';' before identifier 'GetProcAddress'          WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 189

Error      C2659    '=': function as left operand        WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 196

Error      C2146    syntax error: missing ';' before identifier 'GetProcAddress'          WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 196

Error      C2664    'nsresult NS_NewNativeLocalFile(const nsACString &,bool,nsIFile **)': cannot convert argument 3 from 'nsGetterAddRefs<nsILocalFile>' to 'nsIFile **'        WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 208

Error      C2664    'nsresult NS_NewNativeLocalFile(const nsACString &,bool,nsIFile **)': cannot convert argument 3 from 'nsGetterAddRefs<nsILocalFile>' to 'nsIFile **'        WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 216

Error      C2440    'return': cannot convert from 'nsresult' to 'int'    WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 244

Error      C2440    '=': cannot convert from 'PRUint32' to 'nsresult'                WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 239

Error      C4996    'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.     WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 161

Error      C4996    'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.     WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 176

Error      C4996    'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.     WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 182

Error      C4996    'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.     WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 204

Error      C2440    '<function-style-cast>': cannot convert from 'TCHAR [2048]' to 'NS_ConvertASCIItoUTF16_external'                WinEmbed         c:\users\p4481680\documents\winembed\winembed\winembed.cpp 535

Error      C2228    left of '.get' must have class/struct/union            WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 535

Error      C2664    'BOOL SetDlgItemTextW(HWND,int,LPCWSTR)': cannot convert argument 3 from 'const nsACString::char_type *' to 'LPCWSTR'  WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 925

Error      C2664    'BOOL SetDlgItemTextW(HWND,int,LPCWSTR)': cannot convert argument 3 from 'const nsACString::char_type *' to 'LPCWSTR'  WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 948

Error      C2065    'PBM_SETRANGE': undeclared identifier              WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 991

Error      C4996    'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.     WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 1065

Error      C2065    'PBM_SETPOS': undeclared identifier     WinEmbed                c:\users\p4481680\documents\winembed\winembed\winembed.cpp 992

Error      C4996    'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. See online help for details.          WinEmbed                c:\users\p4481680\documents\winembed\winembed\sdk\xulrunner-41.0.2.en-us.win32.sdk\xulrunner-sdk\include\js\utility.h 155

Error      C1083    Cannot open include file: 'nsIProfileChangeStatus.h': No such file or directory    WinEmbed                c:\users\p4481680\documents\winembed\winembed\webbrowserchrome.cpp             48

Я не видел файл, указывающий все необходимые зависимости для проекта. Вы видели где-нибудь все необходимые зависимости / файлы для включения в проект? Я сделал ошибку во время манипуляции? Совместим ли пример проекта WinEmbed с моим приложением WIN32?

Спасибо

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]