Bruce,
Unfortunately, there are issues with the way your code is calling the
pcrecpp functions.
On the bright side, compiling with your dummy header works (the test
script says so anyway) and commenting out the offending function
produces a working plugin linked to pcrecpp.dll.
I didn't amend your code as per your message dated 10.12.2006 21:38 but
I don't think it should have any bearing on what doesn't compile.
There's a problem with the Arg class as you suspected. I got errors like
this one (truncated):
re.cpp:315: error: no matching function for call to
`pcrecpp::RE::FullMatch(CHAR*&, std::string, ...
pcrecpp.h:526: note: candidates are: bool pcrecpp::RE::FullMatch(const
pcrecpp::StringPiece&, const pcrecpp::Arg&, ...
When replacing your line:
#define NULL_RE_ARG NULL
with a line such as this one:
Arg* NULL_RE_ARG = new Arg();
I get those errors like those instead:
re.cpp:300: error: no match for ternary 'operator?:' in '(n > 0) ? s[0]
: NULL_RE_ARG'
Keeping that change and replacing the offending conditions:
(n>0?s[0]:NULL_RE_ARG),
with something like this:
s[0],
yields more errors but replacing them with that works:
*NULL_RE_ARG,
Because I'm not sure what that part of the code is supposed to do or how
the Arg class works, I didn't try to fix your code in a way that would
preserve it's functionality.
It looks like there's a typo in your code BTW:
(n>6?s[5]:NULL_RE_ARG)
And since the issue above is unresolved, I didn't investigate the other
errors I got (type problems which shouldn't be too hard to fix apparently):
re.cpp: In function `void DoReplace(CHAR**, UINT, bool)':
re.cpp:412: error: no matching function for call to
`pcrecpp::RE::GlobalReplace(std::string&, std::string&)'
pcrecpp.h:586: note: candidates are: int
pcrecpp::RE::GlobalReplace(const pcrecpp::StringPiece&, std::string*) const
re.cpp:414: error: no matching function for call to
`pcrecpp::RE::Replace(std::string&, std::string&)'
pcrecpp.h:583: note: candidates are: bool pcrecpp::RE::Replace(const
pcrecpp::StringPiece&, std::string*) const
re.cpp: In function `void extract(CHAR*, CHAR*, BOOL (*)(CHAR*, CHAR*),
void (*)(CHAR*, CHAR*), DWORD*, UINT, CHAR**, PPROSERVICES*)':
re.cpp:468: error: no matching function for call to
`pcrecpp::RE::Extract(std::string&, std::string&, std::string&)'
pcrecpp.h:590: note: candidates are: bool pcrecpp::RE::Extract(const
pcrecpp::StringPiece&, const pcrecpp::StringPiece&, std::string*) const
brucexs wrote:
>> I didn't try to link to pcrecpp yet but, FYI, I had to change your
> ultoa
>> calls (not ANSI!) to sprintf calls to get it to compile at all.
>
> Did not know that. What about itoa and atoi?
atoi is in. itoa isn't.
windows.h needs to be included to compile PP plugins BTW.