Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gvim :make command does not work

Tags:

c++

vim

makefile

I am under a Unix environment, working in C++. I'm opening gvim from a directory in which a makefile called "Makefile" exists. When I try to use ":make" from within vim, I get:

shell returned 2 (1 of 1): make: *** No targets specified and no makefile found. Stop.

like image 852
Amir Rachum Avatar asked Dec 29 '22 16:12

Amir Rachum


2 Answers

Do you have autochdir enabled? That may change to another directory.

Check with :pwd to see if the current directory is what you expect.

Try running :!ls to see if the Makefile exists.

like image 189
richq Avatar answered Jan 05 '23 10:01

richq


Can you check the following options?

:set shell?
:set shelltype?

Finally, check the contents of your shell login file. For example, if your shell is bash, check ~/.bashrc. Does this file contain something like the following?

cd ~

Or:

cd /home/${USERNAME}

where ${USERNAME} is (obviously) your username.

like image 22
DrAl Avatar answered Jan 05 '23 11:01

DrAl