winpty
winpty copied to clipboard
Error when building under cygwin: cygwin_conv_to_win32_path was not declared in this scope
Trying to build under the latest Cygwin as of today. Installed requirement packages as per the readme: mingw64-x86_64-gcc-g++ gcc-g++ make
Ran ./configure, then make, then got this error:
Compiling src/unix-adapter/main.cc
src/unix-adapter/main.cc: In function ‘std::string convertPosixPathToWin(const string&)’:
src/unix-adapter/main.cc:225:5: error: ‘cygwin_conv_to_win32_path’ was not declared in this scope; did you mean ‘cygwin_conv_path’?
225 | cygwin_conv_to_win32_path(path.c_str(), tmp);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| cygwin_conv_path
make: *** [src/unix-adapter/subdir.mk:24: build/unix-adapter/unix-adapter/main.o] Error 1
Thanks.
I had to change the main.cc
Maybe there is some error due to false commenting. I removed the if statement alltogether:
static std::string convertPosixPathToWin(const std::string &path)
{
char *tmp;
// MSYS2 and versions of Cygwin released after 2009 or so use this API.
// The original MSYS still lacks this API.
ssize_t newSize = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_ABSOLUTE,
path.c_str(), NULL, 0);
assert(newSize >= 0);
tmp = new char[newSize + 1];
ssize_t success = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_ABSOLUTE,
path.c_str(), tmp, newSize + 1);
assert(success == 0);
std::string ret(tmp);
delete [] tmp;
return ret;
}
I had to change the main.cc
Maybe there is some error due to false commenting. I removed the if statement alltogether:
static std::string convertPosixPathToWin(const std::string &path) { char *tmp; // MSYS2 and versions of Cygwin released after 2009 or so use this API. // The original MSYS still lacks this API. ssize_t newSize = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_ABSOLUTE, path.c_str(), NULL, 0); assert(newSize >= 0); tmp = new char[newSize + 1]; ssize_t success = cygwin_conv_path(CCP_POSIX_TO_WIN_A | CCP_ABSOLUTE, path.c_str(), tmp, newSize + 1); assert(success == 0); std::string ret(tmp); delete [] tmp; return ret; }
thank you for reply, perfectly works.