[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Error with Makefile
From: |
sam wun |
Subject: |
Error with Makefile |
Date: |
Wed, 06 Apr 2005 22:23:26 +0800 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 |
Hi,
I don't know how to build a proper Makefile for a C++ project.
Here is the Makefile I m currently use:
CC = g++
CXXFLAGS = -O -pipe
INCS = -I/usr/local/include
#LIBS = -l/usr/local/lib/libregexx.a
#LIBS = /usr/local/lib/libregexx.la
#LIBS = -L/usr/local/lib -lregexx
LIBS = /usr/local/lib/libregexx.a
#LIBTOOL = $(SHELL) /usr/local/bin/libtool13
#CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS)
$(LDFLAGS) -o $@
OBJS = simple.o
PROGS = simple
all: ${PROGS}
#simple: ${OBJS} simple.h
simple: ${OBJS} ${LIBS}
${CC} ${CXXFLAGS} -o $@ ${OBJS} ${LIBS} ${INCS}
simple.o: simple.cpp
$(CC) $(INCS) -c $< -o $@
clean:
rm -f ${PROGS} *.o *.core
The Makefil generated the following error:
# make
g++ -O -pipe -o simple simple.o /usr/local/lib/libregexx.a
-I/usr/local/include
/usr/local/lib/libregexx.a(regexx.o)(.text+0x45): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_compile'
/usr/local/lib/libregexx.a(regexx.o)(.text+0x200): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_fullinfo'
/usr/local/lib/libregexx.a(regexx.o)(.text+0x22f): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_study'
/usr/local/lib/libregexx.a(regexx.o)(.text+0x345): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_exec'
/usr/local/lib/libregexx.a(regexx.o)(.text+0x3a0): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_exec'
/usr/local/lib/libregexx.a(regexx.o)(.text+0x57b): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_exec'
/usr/local/lib/libregexx.a(regexx.o)(.text+0x818): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_exec'
/usr/local/lib/libregexx.a(regexx.o)(.text+0xc77): In function
`regexx::Regexx::exec(int)':
: undefined reference to `pcre_exec'
*** Error code 1
Can anyone tell me how to correct this error?
Thanks
Sam
- Error with Makefile,
sam wun <=