I am using Windows Vista, and have downloaded a folder of files in C++ with a Makefile. I would like to run the makefile to compile the source files with header files under Windows. In the end I would like to be able to call this C++ function from MATLAB's command prompt afterwards, so I assume that if I use cygwin this will not be possible because it only allows the compilation to be run from within cygwin.
I installed the Windows SDK 7.1 and from its commond prompt moved into the directory where the makefile and source lies and nmake -f Makefile
and got the response Makefile(13) : fatal error U1001: syntax error : illegal character '^' in macro Stop.
I installed visual studio express 2010 and from its command prompt tried the same. Thes functions are widely known and have been used from here - link to page hosting the c++ files. So I doubt that there is an error with the functions themselves.
How can I run the makefile to compile these files and subsequently run them?
EDIT: this is the makefile:
#!/bin/bash
CC=g++
CFLAGS= -ansi -O5 -Wall
LDFLAGS= -ansi -lm -Wall
EXEC=community convert hierarchy
OBJ1= graph_binary.o community.o
OBJ2= graph.o
all: $(EXEC)
community : $(OBJ1) main_community.o
$(CC) -o $@ $^ $(LDFLAGS)
convert : $(OBJ2) main_convert.o
$(CC) -o $@ $^ $(LDFLAGS)
hierarchy : main_hierarchy.o
$(CC) -o $@ $^ $(LDFLAGS)
##########################################
# Generic rules
##########################################
%.o: %.cpp %.h
$(CC) -o $@ -c $< $(CFLAGS)
%.o: %.cpp
$(CC) -o $@ -c $< $(CFLAGS)
clean:
rm -f *.o *~ $(EXEC)
EDIT2: I installed make from gnu and this is the output:
Here is the dir
09/04/2013 17:13 <DIR> .
09/04/2013 17:13 <DIR> ..
24/09/2008 13:45 7,742 community.cpp
10/07/2008 13:41 4,386 community.h
10/07/2008 13:41 3,919 graph.cpp
10/07/2008 13:41 1,329 graph.h
10/07/2008 13:41 5,957 graph_binary.cpp
10/07/2008 13:41 3,434 graph_binary.h
23/07/2008 17:08 4,071 main_community.cpp
10/07/2008 13:41 2,110 main_convert.cpp
10/07/2008 13:41 3,449 main_hierarchy.cpp
10/07/2008 13:43 565 Makefile
23/07/2008 17:13 2,959 readme.txt
09/04/2013 17:13 <DIR> sample_networks
11 File(s) 39,921 bytes
3 Dir(s) 25,152,544,768 bytes free
And running the make -f Makefile gives
:
g+++ -o graph_binary.o -c graph_binary.cpp -ansi -05 -Wall
process_begin: CreateProcess(NULL, g++ -o graph_binary.o -c graph_binary.cpp -ansi -05 -Wall, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [graph_binary.o] Error 2
but these files are listed in the dir so I do not know why there is an error.