Hello everyone.

I am new to creating make files. I have been able to create simple makefiles for those applications which do not involve database but am unable to create for the ones that do involve database. When I run that make file, it just deletes the .exe file of that application from the folder. Could anyone please help me with this.

That's how my make file looks

INCLUDES = -I/usr/include/mysql++ -I/usr/include/mysql
LIBRARY = -L/usr/lib64/ -L/usr/lib64/mysql -lmysqlpp
SOURCE = /usr/local/babbage/bin/BreachCheck

VPATH = $(INCLUDES) $(LIBRARY) $(SOURCE)

OBJS = breachtester.o breachwriter.o cherrypicker.o datecl.o formatter.o frontrunner.o liffeconnect.o \
    liffe_runbreach.o logger.o positionmonitor.o reportwriter.o

CC = g++

DEBUG = -g

CFLAGS = -Wall -c $(DEBUG)

LFLAGS = -Wall $(DEBUG)

liffe_runbreach-64bit : $(OBJS)
    $(CC) $(LFLAGS) $(OBJS) -o liffe_runbreach-64bit

breachtester.o : breachtester.h breachtester.cpp breachwriter.h logger.h formatter.h \
        datecl.h liffeconnect.h 
        $(CC) $(INCLUDES) $(CFLAGS) breachtester.cpp

breachwriter.o : breachwriter.h breachwriter.cpp breachtester.h liffeconnect.h
    $(CC) $(INCLUDES) $(CFLAGS) breachwriter.cpp

cherrypicker.o : cherrypicker.h cherrypicker.cpp reportwriter.h
    $(CC) $(INCLUDES) $(CFLAGS) cherrypicker.cpp

datecl.o : datecl.h datecl.cpp 
    $(CC) $(CFLAGS) datecl.cpp

formatter.o : formatter.h formatter.cpp
    $(CC) $(CFLAGS) formatter.cpp

frontrunner.o : frontrunner.h frontrunner.cpp liffeconnect.h reportwriter.h
    $(CC) $(INCLUDES) $(CFLAGS) frontrunner.cpp

liffeconnect.o : liffeconnect.h liffeconnect.cpp logger.h formatter.h breachtester.h
    $(CC) $(INCLUDES) $(CFLAGS) liffeconnect.cpp

logger.o : logger.h logger.cpp 
    $(CC) $(CFLAGS) logger.cpp

positionmonitor.o : positionmonitor.h positionmonitor.cpp logger.h formatter.h
    $(CC) $(INCLUDES) $(CFLAGS) positionmonitor.cpp

reportwriter.o : reportwriter.h reportwriter.cpp frontrunner.h liffeconnect.h
    $(CC) $(INCLUDES) $(CFLAGS) reportwriter.cpp

liffe_runbreach.o : liffe_runbreach.cpp datecl.h logger.h breachtester.h liffeconnect.h formatter.h \
            breachwriter.h cherrypicker.h frontrunner.h reportwriter.h
    $(CC) $(INCLUDES) $(CFLAGS) liffe_runbreach.cpp

clean:
    \rm *.o *~ liffe_runbreach-64bit

tar:
    tar cfv liffe_runbreach-64bit.tar breachwriter.h breachwriter.cpp cherrypicker.h \
        cherrypicker.cpp logger.cpp logger.h breachtester.cpp breachtester.h datecl.h datecl.cpp \
        frontrunner.h frontrunner.cpp positionmonitor.h positionmonitor.cpp liffe_runbreach.cpp

it gives me the following error message

collect2: ld returned 1 exit status
make: *** [liffe_runbreach-64bit] Error 1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.