Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
909 stars 99 forks source link

How to make irony work on MinGW64 of msys64 #317

Open danyuhao opened 8 years ago

danyuhao commented 8 years ago

Irony works perfectly on Cygwin64 with my C project. And I want to move it to MinGW64 because the pool performance of Cygwin-emacs. I install the irony server with an addon option -G "MINGW Makefile" , because I use mingw-clang/llvm and mingw-gcc/make/cmake, and I start MinGW-emacs from MinGW64 bash:

cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX\=c\:/msys64/home/y00329832/.emacs.d/irony/ c\:/msys64/home/y00329832/.emacs.d/elpa/irony-20160628.1329/server && cmake --build . --use-stderr --config Release --target install
-- Irony package version is '0.2.0'
-- Found emacs: C:/msys64/mingw64/bin/emacs.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/y00329832/AppData/Local/Temp/build-irony-server-0.2.0
[100%] Built target irony-server
Install the project...
-- Install configuration: "Release"
-- Up-to-date: C:/msys64/home/y00329832/.emacs.d/irony/bin/irony-server.exe

When I used irony for completion in my c project , it only told Error in post-command-hook (irony-completion--post-command): (file-error "Writing to process" "bad file descriptor" #<process Irony>)

danyuhao commented 8 years ago

And when I followed this Setting up irony mode on Windows using Msys2 and Mingw Packages, I got these errors:

$ cmake -G "MSYS Makefiles" ..
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_AR was not found, please set to archive program.
-- Configuring incomplete, errors occurred!

Is this meant to use a msys-clang but not a mingw-clang??

fspeech commented 8 years ago

@danyuhao cmake -G options refer to the shell you use to run the build. So if you are building using the Windows command prompt you should use MinGW Makefiles. Either way the executable built should be windows native.

You can refer to cmake documentation