Re: [Dev-C++] Is a struct preserved when used into a cpp file?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Cassius V. de M. <cvi...@uo...> - 2004-01-27 17:49:04
|
>
> ---------- In=EDcio da mensagem original -----------
> De: Per Westermark <pw...@ia...>
> Para: Vinicius <cvi...@uo...>
> Cc: dev...@li...
> Data: Tue, 27 Jan 2004 16:37:43 +0100 (CET)
> Assunto: Re: [Dev-
C++] Is a struct preserved when used into a cpp file?
> If the MD5Init function is implemented in C, you should modi
fy the header
> file to specify
>
> #ifdef __cplusplus
> extern "C" {
> #endif
> ...
>
> #ifdef __cplusplus
> }
> #endif
>
> To make sure that a c++ program knows that the MD5Init
() function should
> be called with the C calling convention, and that the name i
sn't mangled
> in the library, i.e. that the code should link with a symbol
called
> _MD5Init
>
> /Per W
>
> On Tue, 27 Jan 2004, Vinicius wrote:
>
> > Hello,
> >
> > a) I have a .h (header file) that declares a struct:
> > ...
> > typedef struct {
> > UINT4 state[4]; /* state (ABCD) */
> > UINT4 count
[2]; /* number of bits, modulo 2^64 (lsb first) */
> > unsigned char buffer[64]; /* input buffer */
> > } MD5_CTX;
> > ...
> >
> > b) and I have .c (C source file) that uses the header abov
e:
> > ...
> > void MD5Init(MD5_CTX *context);
> > ...
> >
> > c) I have created a .lib (library file) with the functions
above.
> >
> > I have used the header file above into a .cpp (C++ source
file). The .cpp
> > file uses the .lib functions, but the compiles says "Unres
olved external
> > MD5Init(MD5_CTX*) ...".
> >
> > I think the .lib was included correctly on the project, so
is a struct
> > preserved when used into a cpp file?
> >
> > Thanks in advance, Vinicius.
> >
> > PS: I'm using actually the Borland C++Builder 3 IDE for th
is project, but my
> > doubts is concerned about the theory, excuse me for anythi
ng.
> >
>
>
Yes, I did do this approach and worked sucessfully.
Thanks a lot, Vinicius.
---
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - =C9 gr=E1tis!
http://antipopup.uol.com.br
|