9

I am trying to run makefile on windows7. I have added make.exe in windows path variable and I am trying to run "make -f makefile.txt" but it shows error

"cc -o edit main.o kbd.o command.o display.o insert.o search.o files.o utils.o
process_begin: CreateProcess(NULL, cc -o edit main.o kbd.o command.o display.o i
nsert.o search.o files.o utils.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [edit] Error"

Please help me as i am new to make concept.

Shivang
  • 99
  • 1
  • 1
  • 4

3 Answers3

8

It is not sufficient to just add make.exe to the path. Your problem is that cc can not be found while trying to make the target called edit. Try running the same command from an MinGW/MSYS or CygWin shell, depending on how you installed this. That will most likely give you the proper environment to use make with this makefile.

This issue is similar to copy a file using a makefile at runtime

Community
  • 1
  • 1
Reinier Torenbeek
  • 16,669
  • 7
  • 46
  • 69
  • Thanks for your feedback.... now i have used GCC arm-tool chain it shows below error arm-none-eabi-gcc -o edit main.o kbd.o command.o display.o insert.o search.o fil es.o utils.o c:/shiavng/gcctoolchain/bin/../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none- eabi/lib\libc.a(lib_a-exit.o): In function `exit': exit.c:(.text.exit+0x2c): undefined reference to `_exit' collect2: ld returned 1 exit status make: *** [edit] Error 1 – Shivang Oct 24 '12 at 19:37
  • I do not think that this new problem is related to the original issue -- in any case I do not know the answer. You are better of posing it as a new question with the right tags. – Reinier Torenbeek Oct 25 '12 at 00:57
2

To make it work install MinGW (mingw-get-setup.exe) which will install mingw-get.exe utility that could be used to install all needed build tools.

With C:\Mingw\bin (or whatever path selected during installation) on $PATH type in console:

$ mingw-get.exe gcc g++ msys-base  

After it finishes MSYS env will be available with all necessary tools (execute C:\MinGW\msys\1.0\msys.bat to open it)

Now you can use make like in unix envs.

Mike@Mike-PC ~
$ make
make: *** No targets specified and no makefile found.  Stop.


If it is not enough install mingw32-make as well with mingw-get.
Michal K
  • 321
  • 2
  • 4
0

For some things on windows you'll want to install coreutils. I had this issue for nordic nrf micro issues with make but it's the same error

http://gnuwin32.sourceforge.net/packages/coreutils.htm

Landed here on a re-install of windows scratching head. This was the fix as it adds a bunch of useful commands to windows. Like why did "ls" work on my old drive and not the new one... answer core-utils. Why does it build everywhere and not here -- core-utils. Hope this helps someone in another 8 years.