Linux make file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Linux make file
# 1  
Old 11-22-2010
Linux make file

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

HTML Code:
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
# 2  
Old 11-22-2010
Which file is it deleting?
# 3  
Old 11-22-2010
the .exe file

---------- Post updated at 04:19 PM ---------- Previous update was at 04:19 PM ----------

and the message the end is

Code:
collect2: ld returned 1 exit status
make: *** [liffe_runbreach-64bit] Error 1

# 4  
Old 11-22-2010
There is no .exe file listed in your makefile. .exe files are windows files. I'm guessing you mean "liffe_runbreach-64bit" but that's only a guess.

I don't think it's "deleting" it, it's never creating it in the first place due to some error, which I don't see posted.

Please post any errors above the error you posted.
# 5  
Old 11-22-2010
yes the file it deletes is "liffe_runbreach-64bit". When I run this make file, the file "liffe_runbreach-64bit" gets deleted.

there is a long message before the line I posted above which is as follows:

Code:
g++ -I/usr/include/mysql++ -I/usr/include/mysql -Wall -c -g liffe_runbreach.cpp
In file included from liffe_runbreach.cpp:15:
logger.h: In member function ‘Logger& Logger::operator=(const Logger&)’:
logger.h:21: warning: no return statement in function returning non-void
liffe_runbreach.cpp: In function ‘bool PreProcessDB(mysqlpp::Connection&, std::string, int&, int&, size_t&, std::string&, std::string&)’:
liffe_runbreach.cpp:254: warning: comparison between signed and unsigned integer expressions
g++ -Wall -g breachtester.o breachwriter.o cherrypicker.o datecl.o formatter.o frontrunner.o liffeconnect.o liffe_runbreach.o logger.o positionmonitor.o reportwriter.o -o liffe_runbreach-64bit
breachtester.o: In function `BreachTester::ProcessQuery(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:86: undefined reference to `mysqlpp::Connection::query(char const*)'
breachtester.o: In function `BreachTester::GetHalfTrades(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:266: undefined reference to `mysqlpp::Connection::query(char const*)'
breachtester.o: In function `BreachTester::DeleteDupes(std::vector<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::allocator<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&)':
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:316: undefined reference to `mysqlpp::Connection::query(char const*)'
breachtester.o: In function `DeBreachTester::ProcessQuery(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:361: undefined reference to `mysqlpp::Connection::query(char const*)'
breachtester.o: In function `DeBreachTester::GetHalfTradeQueryString(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:462: undefined reference to `mysqlpp::Connection::query(char const*)'
breachtester.o:/usr/local/babbage/bin/BreachCheck/breachtester.cpp:551: more undefined references to `mysqlpp::Connection::query(char const*)' follow
breachtester.o: In function `BlockMABreachTester::ProcessBlockMA(std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >*, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >*> > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&, unsigned long&, unsigned long&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:1793: undefined reference to `mysqlpp::Query::reset()'
/usr/local/babbage/bin/BreachCheck/breachtester.cpp:1838: undefined reference to `mysqlpp::Query::reset()'
breachtester.o: In function `mysqlpp::String::c_str() const':
/usr/include/mysql++/mystring.h:288: undefined reference to `mysqlpp::String::data() const'
breachtester.o: In function `mysqlpp::String::operator char const*() const':
/usr/include/mysql++/mystring.h:533: undefined reference to `mysqlpp::String::data() const'
breachtester.o: In function `mysqlpp::Row::operator[](int) const':
/usr/include/mysql++/row.h:328: undefined reference to `mysqlpp::Row::at(unsigned long) const'
breachtester.o: In function `mysqlpp::Query::str()':
/usr/include/mysql++/query.h:277: undefined reference to `mysqlpp::Query::str(mysqlpp::SQLQueryParms&)'
breachtester.o: In function `mysqlpp::Query::store()':
/usr/include/mysql++/query.h:467: undefined reference to `mysqlpp::Query::str(mysqlpp::SQLQueryParms&)'
/usr/include/mysql++/query.h:467: undefined reference to `mysqlpp::SQLTypeAdapter::SQLTypeAdapter(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/usr/include/mysql++/query.h:467: undefined reference to `mysqlpp::Query::store(mysqlpp::SQLTypeAdapter const&)'
breachtester.o: In function `unsigned long mysqlpp::String::do_conv<unsigned long>(char const*) const':
/usr/include/mysql++/mystring.h:615: undefined reference to `mysqlpp::String::length() const'
/usr/include/mysql++/mystring.h:615: undefined reference to `mysqlpp::String::data() const'
/usr/include/mysql++/mystring.h:645: undefined reference to `mysqlpp::String::data() const'
/usr/include/mysql++/mystring.h:645: undefined reference to `mysqlpp::String::length() const'
cherrypicker.o: In function `CherryPicker::FindCherryPicking()':
/usr/local/babbage/bin/BreachCheck/cherrypicker.cpp:42: undefined reference to `mysqlpp::Connection::query(char const*)'
cherrypicker.o: In function `CherryPicker::GetCherryHT(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/usr/local/babbage/bin/BreachCheck/cherrypicker.cpp:141: undefined reference to `mysqlpp::Connection::query(char const*)'
cherrypicker.o: In function `long mysqlpp::String::do_conv<long>(char const*) const':
/usr/include/mysql++/mystring.h:615: undefined reference to `mysqlpp::String::length() const'
/usr/include/mysql++/mystring.h:615: undefined reference to `mysqlpp::String::data() const'
/usr/include/mysql++/mystring.h:645: undefined reference to `mysqlpp::String::data() const'
/usr/include/mysql++/mystring.h:645: undefined reference to `mysqlpp::String::length() const'
frontrunner.o: In function `FrontRunner::FindTrsFR()':
/usr/local/babbage/bin/BreachCheck/frontrunner.cpp:69: undefined reference to `mysqlpp::Connection::query(char const*)'
frontrunner.o: In function `FrontRunner::GetHalfTrades(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/usr/local/babbage/bin/BreachCheck/frontrunner.cpp:550: undefined reference to `mysqlpp::Connection::query(char const*)'
liffe_runbreach.o: In function `main':
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:106: undefined reference to `mysqlpp::Connection::Connection(bool)'
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:110: undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:211: undefined reference to `mysqlpp::Connection::~Connection()'
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:211: undefined reference to `mysqlpp::Connection::~Connection()'
liffe_runbreach.o: In function `PreProcessDB(mysqlpp::Connection&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int&, int&, unsigned long&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:232: undefined reference to `mysqlpp::Connection::query(char const*)'
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:237: undefined reference to `mysqlpp::Query::operator void*() const'
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:285: undefined reference to `mysqlpp::Query::reset()'
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:322: undefined reference to `mysqlpp::Query::reset()'
liffe_runbreach.o: In function `ProcessDB(mysqlpp::Connection&)':
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:445: undefined reference to `mysqlpp::Connection::query(char const*)'
liffe_runbreach.o: In function `PostProcessDB(mysqlpp::Connection&)':
/usr/local/babbage/bin/BreachCheck/liffe_runbreach.cpp:461: undefined reference to `mysqlpp::Connection::query(char const*)'
liffe_runbreach.o: In function `mysqlpp::Query::execute()':
/usr/include/mysql++/query.h:342: undefined reference to `mysqlpp::Query::str(mysqlpp::SQLQueryParms&)'
/usr/include/mysql++/query.h:342: undefined reference to `mysqlpp::SQLTypeAdapter::SQLTypeAdapter(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/usr/include/mysql++/query.h:342: undefined reference to `mysqlpp::Query::execute(mysqlpp::SQLTypeAdapter const&)'
positionmonitor.o: In function `PositionMonitor::GetPositionInfo(std::vector<PositionMonitor::PosMonitor, std::allocator<PositionMonitor::PosMonitor> >&)':
/usr/local/babbage/bin/BreachCheck/positionmonitor.cpp:43: undefined reference to `mysqlpp::Connection::query(char const*)'
positionmonitor.o: In function `bool mysqlpp::String::operator==<char [2]>(char const (&) [2]) const':
/usr/include/mysql++/mystring.h:495: undefined reference to `mysqlpp::String::compare(char const*) const'
collect2: ld returned 1 exit status
make: *** [liffe_runbreach-64bit] Error 1

# 6  
Old 11-23-2010
Well, I would say that looks pretty significant. Can we see the relevant code?
# 7  
Old 11-23-2010
Hello Corona688

Are you talking about the make file or the classes involved in this application. There are many classes with lots of code. Which one should I post?

Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to make a .exe file executable in Linux?

Dear all, I download a .exe file in my current folder called: ukbmd5.exe. I was told to run the command below: ukbmd5 ukb25278.enc to verify the integrity of the files that you have downloaded and the program ukbmd5 has been made available to assist with decrpying ukb25278.enc. while when I run... (1 Reply)
Discussion started by: forevertl
1 Replies

2. Shell Programming and Scripting

I need to make a control panel for a Linux script

has anyone got experience using jsch? Does it give me a prompt when I run a command/ print result back to me. I need to send commands to a linux database like restart,shutdown,stop database caching etc. But in java I want to build a GUI I can use. TO call database commands. and do these... (3 Replies)
Discussion started by: Samuel12
3 Replies

3. Shell Programming and Scripting

extension building make GNU Linux

Hi, I do "touch poub.mlc" Download my Makefile, But when I try : make -f Makefile.txt(.txt in order my file to be accepted for upload), it says:"no rule for poub.mlo target" What is wrong in my Makefile(test yourself please before posting)? (1 Reply)
Discussion started by: synhedionn
1 Replies

4. Linux

Linux make bootable archive

Can anybody suggest me software to backup Linux server and to make them boot able (1 Reply)
Discussion started by: Vit0_Corleone
1 Replies

5. UNIX for Dummies Questions & Answers

How to make linux look in ./ by default

if i want to run a file from my current directory i have to do ./myfile how i should config my linux to look automatically in ./ thanks (3 Replies)
Discussion started by: pureMind
3 Replies

6. Programming

makeutility: how to get the make-file name inside of the make-file?

How I can get the current make-file name in a make-file So, if I run make with specified file:make -f target.mak is it possible to have the 'target' inside of the that 'target.mak' from the file name? (2 Replies)
Discussion started by: alex_5161
2 Replies

7. Red Hat

Re:How to make the linux pc faster

Hi, Can any one help me out in solving the problem i have a linux database server it is tooo slow that i am unable to open even the terminial is there any solution to get rid of this problem.How to make this server faster. Thanks & Regards Venky (0 Replies)
Discussion started by: venky_vemuri
0 Replies

8. Filesystems, Disks and Memory

How to mount/make a FAT system on Linux

Yea i was wondering how i would mount, and create a FAT directory that way i can save files in the FAT directory in a windows system and be able to access them on Linux systems. Or if there is any other way to share files between Linux and Windows. Any responds will help... thanks! (2 Replies)
Discussion started by: kyoist
2 Replies

9. UNIX for Dummies Questions & Answers

How to make you linux server for telnet????

I have RH7.2 OS and I want my freinds to login my sys I have TCP/IP connection ppp and I know my IP also I know this ppp-18-21.cyberia.net.... I want my freinds to use Telnet How to configure it plz Help files PDF ...my freinds has ppp and LAN .......configuration for telnet also my Host is... (4 Replies)
Discussion started by: atiato
4 Replies
Login or Register to Ask a Question