mecab icon indicating copy to clipboard operation
mecab copied to clipboard

WPATH_FORCE() not defined on windows when compiling with msvc.

Open MiguelAmaro opened this issue 2 years ago • 0 comments

I'm trying to compile on Windows (x64) using the make.bat file found in .\mecab\mecab\src\ and had the following errors occur. I noticed that the WPATH(path) gets preprocessed to WPATH_FORCE(path) which is never defined. Is there a reason for this? compiler version: MSVC 14.32.31326

feature_index.cpp(532): error C3861: 'WPATH_FORCE': identifier not found
feature_index.cpp(540): error C3861: 'WPATH_FORCE': identifier not found
feature_index.cpp(621): error C3861: 'WPATH_FORCE': identifier not found
feature_index.cpp(672): error C3861: 'WPATH_FORCE': identifier not found

https://github.com/taku910/mecab/blob/046fa78b2ed56fbd4fac312040f6d62fc1bc31e3/mecab/src/common.h#L84

#ifdef _WIN32
#ifdef __GNUC__
#define WPATH_FORCE(path) (MeCab::Utf8ToWide(path).c_str())
#define WPATH(path) (path)
#else
//Windows Path using msvc (WPATH_FORCE not defined)
//#define WPATH_FORCE(path) (path)
#define WPATH(path) WPATH_FORCE(path)
#endif
#else
#define WPATH_FORCE(path) (path)
#define WPATH(path) (path)
#endif

MiguelAmaro avatar Jun 09 '22 15:06 MiguelAmaro