Why won't Vim compile my C code? [duplicate] - vim

This question already has answers here:
Closed 13 years ago.
Possible Duplicate:
How can I configure Vim to compile C code using Borland’s compiler on Windows?
I have been trying to compile a simply c code using Gvim 7.2.
I have the Borland bcc32 compiler installed, but I keep getting the message
"make is not recognized as an internal or external command".
What am I doing wrong? What should I include in my _virmrc file to
correct the problem or what configuration do I need to set to compile my code?

Take a look at Introduction to Programming in C/C++ with Vim.
In this situation VIM is looking for your make.exe. Either put this on the path, or set the variable makeprg e.g.
:set makeprg={path to your make exe}

Have you added the directory with Borland's make.exe to your %PATH%?
Right click on My Computer → Properties → Advanced → Environment Variables

That error suggests that Vim cannot find make.
Troubleshooting steps:
Is make installed?
Is the directory containing the make executable in your path?
Can you run make from the command line?
Can you run make from inside of vim?
Information that would help:
Which version of Windows are you using?

Is the path to make in your system path? I would check there first.

Related

How can I set Make Path in Makefile VS Code extension from Linux?

I'm new on this Makefile thing, and I'm having some issues trying to install the Makefile Extension from the VS Code Marketplace.
First of all, I'm using VS Code to connect to a remote machine, with RedHat8 kernel. It uses makefile and it works perfectly on a linux terminal, but now we are trying to migrate to VS Code.
So I was searching and I found this Makefile Extension.
On the extension settings, I have my Makefile Path defined, and it works, but I have some problem with the Make Path, because it is expecting a make.exe kind but I don't have any, because it's a linux server.
I know my make path is on /usr/bin/make, but it says it cannot find make path.
What should I put in there?
PS: Sorry for my bad english, and thank you!
You should not have to set the "Make Path" to anything, it should default to make.
By default the "Makefile Path" is ${workspaceFolder}/Makefile, but you can change it to whatever is required.
If you have a separate build folder, then it's better to set the "Make directory" instead.
For example, Debian packages are built under debian/build/main so set the makeDirectory like this:
{
"makefile.makeDirectory": "${workspaceFolder}/debian/build/main"
}

Specifying coqtop path for CoqIDE Vim plugin on Windows 8.1

I am trying to make the CoqIDE Vim plugin work on Windows 8.1. When I source the plugin from Vim, I get this error message:
coqtop.opt: command not found.
So I looked up the plugin documentation, and found the part that seems relevent:
"coqtop" should be accessible on PATH. If "coqtop" is not in your PATH, add 'let CoqIDE_coqtop = "/path/to/coqtop"' in your "~/.vimrc".
I'm not sure what this means, but I'm guessing that there is some file or directory named coqtop that must be made visible to vim. So I opened my Coq installation directory and searched for coqtop. The search hits are:
coqtop
coqtop.cmi
coqtop.1
coqtop.byte.1
coqtop.opt.1
The obvious first candidate here is coqtop. When I click it, it opens an interactive Coq console. But when I use the let CoqIDE_coqtop command to link this file to Vim and load the plugin again, I get:
C:Program Files (x86)Coq^Hincoqtop.exe: command not found.
Another thing that looks problematic is the file type. As you can see from the error message above, the coqtop file has an .exe extension, which is specific to MS-DOS and Windows. But I don't think the plugin was written to work with .exe files...
I also tried using all the other search hits as coqtop, to no avail.
Does this mean that the plugin is useless on Windows? If someone can confirm that I'll just give up and use other IDEs. But if possible I'd really, really like to keep using Vim.

How do I open Vim using Command?

I just downloaded and started using Vim so I'm still a bit confused with it. I've been watching tutorial videos and I see that I can open Vim by typing vim in command. However when I do it I get
'vim' is not recognized as an internal or external command, operable program or batch file
Did I need to install something else? Also I want to code and compile C in vim, would I need to install a compiler?
You have to invoke Vim (or gvim, the GUI application) with the full path, e.g.
"C:\Program Files\vim\vim74\vim.exe"
The Vim installer doesn't add the location to the PATH. In Windows, you can create a shortcut (*.lnk) in your Start Menu, or re-run "C:\Program Files\vim\vim74\install.exe", which has an option to install batch files to C:\Windows, or manually add "C:\Program Files\vim\vim74" to your PATH via the Control Panel.
Vim is just a (very advanced and powerful) text editor, so it ships with syntax highlighting for most programming languages, but unlike IDEs, it doesn't come with the full toolset of compiler, linker, debugger, etc. You need to separately install that (e.g. mingw, or Microsoft's compiler from the Windows SDK, or any other).
C:\>vim somefile.txt
During Vim (for Win32) install, you have the option to install batch files for launching vim from the command-line.
make sure you install vim properly. (https://www.vim.org/download.php)
On Windows. Don't forget to set the environment variables (simply add \vim\vim**; at the end of the classpath)
Type vim at command line (gvim.exe will start the Graphic user interface software).
If you want to compile and run c program using the command line, you should download the GCC Compiler and follow the same procedure as mentioned before (The classpath thing). Then you can compile C program using gcc command.

How to customize which Windows $PATH environment variables are imported into Cygwin?

I would like to customize the $PATH variables included in the Cygwin environment, how can I do this? One solution I know of is to add the following line to the end of the Cygwin.bat file:
PATH="/usr/local/bin:/usr/bin:/bin"
By default the shortcut starts bin/mintty.exe, how can I change that default behavior?
All Windows environment variables are included in your Cygwin environment automatically on startup. If you'd like to customize what they are, you can overwrite the whole $PATH variable using a line similar to what you already mentioned in your Cygwin.bat file:
PATH="colon:separated:list:of:all:paths"
Also if you'd like to change which terminal is used by Cygwin, one alternative is rxvt.
Another popular solution seems to be using PuttyCyg to putty directly into your Cygwin installation to get the benefits of the Putty terminal. See the effective-cygwin
GitHub page for setup instructions and more.
See this stackoverflow post for a full list of suggested alternatives to the default Cygwin terminal.

CYGWIN=nodosfilewarning doesn't help cygwin warning

When I try to use ediff-revision under Emacs 23.2.1 for a CVS-managed file, I receive the following error in the *ediff-errors* frame, instead of commencing directly to the ediff results:
cygwin warning:
MS-DOS style path detected: c:/Users/BILL/AppData/Local/Temp/misc.cpp.~1.10~
Preferred POSIX equivalent is: /cygdrive/c/Users/BILL/AppData/Local/Temp/misc.cpp.~1.10~
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
My problem is that I have already set that CYGWIN environment variable option "nodosfilewarning", so I have no idea why I am receiving this error.
In fact, I can verify this right from an inferior shell under the same Emacs instance:
> set | grep -i nodos
CYGWIN=nodosfilewarning
I am running Cygwin 1.7.9-1 under Windows 7, in case this may be relevant (and I never had this problem before upgrading from Cygwin 1.5 to 1.7).
Any idea how to get rid of this error?
P.S. A subsequent call to ediff-revision succeeds without triggering this warning.
The CYGWIN variable is parsed when the first process in a Cygwin process tree is invoked. Hence, setting it in .bashrc or something like that is too late. A good place to set it is in the global Windows environment, under Control Panel->System->Advanced->Environment Variables.
I added (setenv "CYGWIN" "nodosfilewarning") to setup-cygwin.el. That seems to take care of the problem without, AFAICT, creating other problems. I also filed Emacs bug #14541 for this.
From within emacs, you may also:
M-x setenv
CYGWIN
nodosfilewarning
as an immediate alternative to altering setup-cygwin.el.

Resources