Home > Back-end >  Strpcopy function declarations conflict question
Strpcopy function declarations conflict question

Time:09-28

Compiled using c + + BUILDER, told strpcopy function used in the declaration were carried out in two header files, lead to conflict, two of the header file and the declaration of the function respectively as follows:

In the System. The AnsiString. Statement of the HPP:
Extern DELPHI_PACKAGE char * __fastcall StrPCopy (Dest, char * const System: : AnsiString Source) phrase/* */.
In the System. The SysUtils. Statement of the HPP:
Extern DELPHI_PACKAGE System: : WideChar * __fastcall StrPCopy (System: : WideChar * Dest, const System: : UnicodeString Source) phrase/* */.


I am using the c + + builder XE6, compiled in the Windows 7 (64),

Try to comment out the System. The AnsiString. The function declarations of HPP, was to compile, but afraid will produce other adverse consequences,
There is no other better way?

CodePudding user response:

Add a namespace
 Sysutils: : StrPCopy (" ", ""); 

CodePudding user response:

Can the using? I have never used

CodePudding user response:

Ok, I will try, thank you!

CodePudding user response:

The header file system at first is not recommended to modify,

StrPCopy despite two prototypes, but with different parameter type is easy to determine which one call, what is your original code?
  • Related