But the same code is working fine if i run it by using Visual studio C++.
The linking options are different/incompatible.
Perl links against
MSVCRT (-MD) or MSVCRTD (-MDd), so you need to make sure pjproject does the same, otherwise you'll get
error LNK2001: unresolved external symbol __pctype.