Skip to content

How to escape backslashes? #22

@kenkangxgwe

Description

@kenkangxgwe

Even though I thought this is a CMake/Ninja problem, since you have successfully built the ccls on Windows, it will be nice if you can help me around this.

This is my cmake command

cmake . -Brelease -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DSYSTEM_CLANG=On -DCMAKE_PREFIX_PATH="D:\\Programs\\msys64\\mingw64\\lib\\clang\\6.0.0\\"
cmake --build release

I tried both / and \\ to split the path, but didn't help.

This caused the following errors:

[8/59] Building CXX object CMakeFiles/ccls.dir/src/main.cc.obj
FAILED: CMakeFiles/ccls.dir/src/main.cc.obj
D:\Programs\msys64\mingw64\bin\clang++.exe  -DDEFAULT_RESOURCE_DIRECTORY=\"D:\Programs\msys64\mingw64\lib\clang\6.0.0\" -DLOGURU_FILENAME_WIDTH=18 -DLOGURU_THREADNAME_WIDTH=13 -DLOGURU_WITH_STREAMS=1 -I../src -I../third_party -I../third_party/rapidjson/include -I../third_party/loguru -I../third_party/doctest -isystem D:/Programs/msys64/mingw64/include -O3 -DNDEBUG   -fno-rtti -Wall -Wno-sign-compare -std=c++1z -MD -MT CMakeFiles/ccls.dir/src/main.cc.obj -MF CMakeFiles\ccls.dir\src\main.cc.obj.d -o CMakeFiles/ccls.dir/src/main.cc.obj -c ../src/main.cc
../src/main.cc:70:3: error: use of undeclared identifier '_setmode'
  _setmode(_fileno(stdout), O_BINARY);
  ^
../src/main.cc:71:3: error: use of undeclared identifier '_setmode'
  _setmode(_fileno(stdin), O_BINARY);
  ^
2 errors generated.
[17/59] Building CXX object CMakeFiles/ccls.dir/src/indexer.cc.obj

Btw, what's the purpose of cmake -H. in the wiki?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions