Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building under cygwin: cygwin_conv_to_win32_path was not declared in this scope #198

Open
ahsodex opened this issue Feb 6, 2023 · 3 comments

Comments

@ahsodex
Copy link

ahsodex commented Feb 6, 2023

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.

@Friesthebeast
Copy link

Friesthebeast commented Jul 28, 2023

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;
}

@qweDisgustin
Copy link

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.

@nykbocks
Copy link

thanks man,i was horried if i changed it would not work,but works perfectly!
1712975977375334s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants