Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"redefinition; different type modifier" in VS2010

I'm trying to compile some code I downloaded in visual studio. The code was intended for msvc 6, and I imported it to VS2010. The code is for providing ASIO support for labview by compiling a DLL. see here for the whole code.

I get the following error when building: "error C2373:'_pctype' : redefinition; different type modifiers."

The code snippet is as follows:

unsigned short _Ints[ 512 ];
unsigned short *_pctype = _Ints;

If anyone will be referencing the package of code from the link I provided, this is from the file GenMonCIN.c

like image 569
brneuro Avatar asked Feb 21 '23 06:02

brneuro


1 Answers

The error message is trying to tell you that _pctype was already defined somewhere else.

It appears that _pctype is an identifier used by Visual Studio since at least version 2005.

_pctype, _pwctype, _wctype, _mbctype, _mbcasemap

These global variables contain information used by the character classification functions. They are for internal use only.

Please never pick names with a leading underscore at namespace scope, they are reserved for the implementation. The person who wrote the library obviously didn't know that, and now you're screwed.

like image 157
fredoverflow Avatar answered Mar 06 '23 06:03

fredoverflow