[C++] Y pas quelqu'un qui aurait 5 minutes ? (Compiler une source)

Y pas quelqu'un qui aurait 5 minutes ? (Compiler une source) [C++] - Programmation

Marsh Posté le 09-01-2002 à 11:03:48    

http://www.rarsoft.com/rar_add.htm
ftp://www.rarsoft.com/rar/UnRARDLL.exe
 
J'ai téléchargé "UnRAR dll module", une DLL pour extraire les .rar. Seulement, impossible de compiler l'exemple avec VC++. J'ai bien ajouté le .lib, le .h et voila les erreurs :
 
Compiling...
UnRDLL.c
f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : error C2143: syntax error : missing ';)' before '*'
f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : error C2143: syntax error : missing ';)' before '*'
f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : error C2143: syntax error : missing '{' before '*'
f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : error C2059: syntax error : ';)'
f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : error C2059: syntax error : ';)'
f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : error C2143: syntax error : missing ';)' before '*'
f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : error C2143: syntax error : missing ';)' before '*'
f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : error C2143: syntax error : missing '{' before '*'
f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : error C2059: syntax error : ';)'
f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : error C2059: syntax error : ';)'
f:\microsoft visual studio\myprojects\unrar\unrdll.c(15) : error C2373: 'ChangeVolProc' : redefinition; different type modifiers
       f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : see declaration of 'ChangeVolProc'
f:\microsoft visual studio\myprojects\unrar\unrdll.c(16) : error C2373: 'ProcessDataProc' : redefinition; different type modifiers
       f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : see declaration of 'ProcessDataProc'
f:\microsoft visual studio\myprojects\unrar\unrdll.c(72) : warning C4013: 'RARSetChangeVolProc' undefined; assuming extern returning int
f:\microsoft visual studio\myprojects\unrar\unrdll.c(75) : warning C4013: 'RARSetProcessDataProc' undefined; assuming extern returning int
f:\microsoft visual studio\myprojects\unrar\unrdll.c(229) : error C2373: 'ChangeVolProc' : redefinition; different type modifiers
       f:\microsoft visual studio\myprojects\unrar\unrar.h(65) : see declaration of 'ChangeVolProc'
f:\microsoft visual studio\myprojects\unrar\unrdll.c(242) : error C2373: 'ProcessDataProc' : redefinition; different type modifiers
       f:\microsoft visual studio\myprojects\unrar\unrar.h(66) : see declaration of 'ProcessDataProc'
Error executing cl.exe.
 
Unrar.exe - 14 error(s), 2 warning(s)
 
Quelqu'un peut-il me venir en aide et me dire comment compiler cette exemple,si il a réussi ? merci

Reply

Marsh Posté le 09-01-2002 à 11:03:48   

Reply

Marsh Posté le 09-01-2002 à 13:11:00    

T'as peut etre oublié d'incluer windows.h avant non?

Reply

Marsh Posté le 09-01-2002 à 13:15:30    

non non en plus j'ai pas retouché à l'exemple, je suppose qu'il marche ! (et il y a bien windows.h)

Reply

Marsh Posté le 09-01-2002 à 15:45:42    

J'ai essayé sous Borland C 5 (ai pas Visual machin).
Ca marche (projet console 32 bits avec unrar.c, unrdll.c, unrdll.def) mais il a fallu que j'incorpore le unrar.h dans le début du C (mon compilo me donnait une erreur : trouvait pas le .h !! (+ cascade d'erreurs)) par copie/collage.
 
J'étais étonné que ça marche directement, mais la DLL était déja installée (par PowerArchiver ??)!! Je suis sous NT4.

Reply

Marsh Posté le 09-01-2002 à 15:50:28    

tout d'abord merci d'avoir essayé !
A mon avis ce qu'il ne marche pas chez moi c'est que je n'ai pas inclu le .def dans mon projet, je ne sais pas quoi en faire ! Tu peux me dire qu'en faire ? merci

Reply

Marsh Posté le 09-01-2002 à 18:47:52    

non non, les .def il s'en sert que pour le linkage, or toi t'as des erreurs de compilation

Reply

Marsh Posté le 09-01-2002 à 18:49:12    

C'est con mais essaie de renommer unrar.c en unrar.cpp

Reply

Marsh Posté le 10-01-2002 à 19:57:11    

ça change rien  :sweat:

Reply

Marsh Posté le 11-01-2002 à 02:21:01    

Je viens de modifier l'entete, ca marche sans pb (vc6 a besoin que l'on mette la convention d'appelle DANS la parenthese du pointeur sur fonction) :
 
#define ERAR_END_ARCHIVE     10
#define ERAR_NO_MEMORY       11
#define ERAR_BAD_DATA        12
#define ERAR_BAD_ARCHIVE     13
#define ERAR_UNKNOWN_FORMAT  14
#define ERAR_EOPEN           15
#define ERAR_ECREATE         16
#define ERAR_ECLOSE          17
#define ERAR_EREAD           18
#define ERAR_EWRITE          19
#define ERAR_SMALL_BUF       20
 
#define RAR_OM_LIST           0
#define RAR_OM_EXTRACT        1
 
#define RAR_SKIP              0
#define RAR_TEST              1
#define RAR_EXTRACT           2
 
#define RAR_VOL_ASK           0
#define RAR_VOL_NOTIFY        1
 
#define RAR_DLL_VERSION       1
 
struct RARHeaderData
{
  char ArcName[260];
  char FileName[260];
  UINT Flags;
  UINT PackSize;
  UINT UnpSize;
  UINT HostOS;
  UINT FileCRC;
  UINT FileTime;
  UINT UnpVer;
  UINT Method;
  UINT FileAttr;
  char *CmtBuf;
  UINT CmtBufSize;
  UINT CmtSize;
  UINT CmtState;
};
 
 
struct RAROpenArchiveData
{
  char *ArcName;
  UINT OpenMode;
  UINT OpenResult;
  char *CmtBuf;
  UINT CmtBufSize;
  UINT CmtSize;
  UINT CmtState;
};
 
 
#ifdef __cplusplus
extern "C" {
#endif
 
 
HANDLE PASCAL RAROpenArchive(struct RAROpenArchiveData *ArchiveData);
int PASCAL RARCloseArchive(HANDLE hArcData);
int PASCAL RARReadHeader(HANDLE hArcData,struct RARHeaderData *HeaderData);
int PASCAL RARProcessFile(HANDLE hArcData,int Operation,char *DestPath,char *DestName);
void PASCAL RARSetChangeVolProc(HANDLE hArcData,int  (_stdcall *ChangeVolProc)(char *ArcName,int Mode));
void PASCAL RARSetProcessDataProc(HANDLE hArcData,int (_stdcall *ProcessDataProc)(unsigned char *Addr,int Size));
void PASCAL RARSetPassword(HANDLE hArcData,char *Password);
int PASCAL RARGetDllVersion();
 
#ifdef __cplusplus
}
#endif

Reply

Marsh Posté le 11-01-2002 à 16:42:48    

Je vais essayer ça, en tout cas merci à vous tous de votre aide !
a+
   ANT
 
 :hello:

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed