?
=?gb2312?B?wfXquw==?=
Hi, folks,
I've googled for the forum focusing on how to write the makefile,
nothing found. So I'd like to ask you guys do me a favor. I am
building a static library under Msys and MinGW, I've found all the
source files I need, and put them into one folder, my makefile looks
like:
CC=g++
CCFLAGS=-w -g
AR=ar
ARFLAGS=cruv
LIBOBJS = a.o
LIBHEADER=
LIBNAME = libtest.a
a.o: *.cpp *.h
$(CC) $(CCFLAGS) -c -o a.o a.cpp
all: $(LIBOBJS)
$(AR) $(ARFLAGS) $(LIBNAME) $(LIBOBJS)
cp $(LIBNAME) $(HOME)/source/openct/sdk/lib
cp $(LIBNAME) /usr/local/lib
clean:
-rm $(LIBOBJS) libtest.a
But when I built the program that linked this lib, a link error
araised, complained that some functions undefined, but the source
files contain the declaration and implementation, thank you.
Best regards.
I've googled for the forum focusing on how to write the makefile,
nothing found. So I'd like to ask you guys do me a favor. I am
building a static library under Msys and MinGW, I've found all the
source files I need, and put them into one folder, my makefile looks
like:
CC=g++
CCFLAGS=-w -g
AR=ar
ARFLAGS=cruv
LIBOBJS = a.o
LIBHEADER=
LIBNAME = libtest.a
a.o: *.cpp *.h
$(CC) $(CCFLAGS) -c -o a.o a.cpp
all: $(LIBOBJS)
$(AR) $(ARFLAGS) $(LIBNAME) $(LIBOBJS)
cp $(LIBNAME) $(HOME)/source/openct/sdk/lib
cp $(LIBNAME) /usr/local/lib
clean:
-rm $(LIBOBJS) libtest.a
But when I built the program that linked this lib, a link error
araised, complained that some functions undefined, but the source
files contain the declaration and implementation, thank you.
Best regards.