C/C++ WIN32 - Gecko - Problème compilation/dépendance

Vous vous penchez sur le développement d'applications ou d'extensions pour Mozilla ? C'est alors vers ce forum que se dirigeront naturellement vos requêtes...

Modérateur : chBok

dark0502
Arias
Messages : 1
Inscription : 09 avr. 2018, 17:04

C/C++ WIN32 - Gecko - Problème compilation/dépendance

Message par dark0502 » 09 avr. 2018, 17:16

J'ai crée une application WIN32 C/C++ via Visual Studio. Ensuite, j'ai été sur l'adresse pour télécharger un exemple de l'utilisation de Gecko : https://github.com/bnoordhuis/mozilla-c ... s/winEmbed .

J'ai donc copié tous les fichiers *.cpp, *h, *.rc dans mon projet. Ensuite, j'ai compilé l'application. Mais j'obtenais plus de 150 erreurs car il y avait des problèmes de dépendances et autres. Donc, j'ai téléchargé le sdk 'xulrunner-41.0.2.en-us.win32.sdk.zip'. J'ai dézippé le fichier. Dans les propriétés de mon projet (C/C++ >> General >> Additional Include Directories), j'ai ajouté les lignes suivantes:

Code : Tout sélectionner

$(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
Mais j'obtiens encore 45 erreurs. Ca me rend fou.

Voici les erreurs :

Code : Tout sélectionner


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 
Je n'ai pas vu de fichiers indiquant toutes les dépendances nécessaires pour le project. Avez-vous déjà vu quelque part tous les fichiers/dépendances nécessaires qu'il faut inclure au projet ? Est-ce que j'ai téléchargé de mauvaises sources ? Est-ce que le projet exemple 'WinEmbed' est bien compatible avec une application WIN32 ?

Merci

Répondre

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 1 invité