LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-22-2010, 07:27 AM   #1
Shh226
LQ Newbie
 
Registered: Mar 2010
Posts: 8

Rep: Reputation: 0
Need help on CD - Database Application using MYSQL


Hello this is my first post. I am a Trainee programmer who needs help on creating an CD database application. I am following the instructions from Linux programming 4th edition to create one by copying the codes. Now the problem occurs when I have to add a makefile I do not uderstand how to use a makefile work. Oh I am making sure I am using tabs - not spaces.

Below shows the code inside the makefile.

all: app

app: app_mysql.c app_test.c app_mysql.h
gcc -o app -I/usr/include/mysql app_mysql.c app_test.c -lmysqlclient -L/usr/lib/mysql


First of all, I am confused about what "-lmysqlclient -L/usr/lib/mysql" means. Also when run the Makefile , I get this error.

~]$ make -f Makefile
make: Nothing to be done for `all'.

Anyone knows what I am doing wrong.
Edit: Also you can download the code from here.

http://www.wrox.com/WileyCDA/WroxTit...-DOWNLOAD.html


and in ch08/app you will find all you need to create the CD database application.

Thank you.
 
Old 03-22-2010, 01:36 PM   #2
nonamenobody
Member
 
Registered: Oct 2002
Posts: 138

Rep: Reputation: 22
Quote:
Originally Posted by Shh226 View Post
I am confused about what "-lmysqlclient -L/usr/lib/mysql" means.
I'm not a C programmer, but I believe tells gcc to look for the 'mysqlclient' in the directory '/usr/lib/mysql'.


Quote:
make: Nothing to be done for `all'.
This means what it says. Most likely you have already run make, so objects are already 'made' - it won't overwrite them by default, so it just tells you that there is nothing to be done. If you delete 'app' and run make again it will re-make it.
 
Old 03-22-2010, 07:25 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Read and absorb http://gcc.gnu.org/onlinedocs/gcc-4....l#Link-Options

I think uppercase L is a typo.
 
Old 03-22-2010, 07:33 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by chrism01 View Post
Read and absorb http://gcc.gnu.org/onlinedocs/gcc-4....l#Link-Options

I think uppercase L is a typo.
Nope, no typo ... it tells it in which DIRECTORY to look for
the libs specified with -l



Cheers,
Tink
 
Old 03-22-2010, 09:09 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Ah well, its been a long time since I did C. Not sure it was even the gcc compiler
 
Old 03-22-2010, 10:15 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by Shh226 View Post
Below shows the code inside the makefile.

all: app

app: app_mysql.c app_test.c app_mysql.h
gcc -o app -I/usr/include/mysql app_mysql.c app_test.c -lmysqlclient -L/usr/lib/mysql


First of all, I am confused about what "-lmysqlclient -L/usr/lib/mysql" means. Also when run the Makefile , I get this error.


$ make -f Makefile
make: Nothing to be done for `all'.

Anyone knows what I am doing wrong.
Well. Make you must have successfully run before,
and now there's nothing to be done... is there an
"app" executable?
 
Old 03-23-2010, 04:36 AM   #7
Shh226
LQ Newbie
 
Registered: Mar 2010
Posts: 8

Original Poster
Rep: Reputation: 0
Ok, I have made it worked. I did not realised I had successfully compile my program. The problem was I did not know how to run the program when all I was suppose to type was

$ ./app

to run. Anyway, it works .
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql is in /var/lib/mysql/[database]....how to transfer to my username? RMLinux Linux - Newbie 14 11-30-2008 10:35 PM
How can i copt the MYSQL Database to a other server (Database) halvorls Linux - Server 3 07-27-2008 09:19 PM
LXer: Visual MySQL Database Design in MySQL Workbench LXer Syndicated Linux News 0 06-12-2008 07:00 PM
LXer: Deployment Seam Application against MySQL 5 database to Jboss 4.0.5 utilizing Seam Plugin for NetBeans 5.5.1 LXer Syndicated Linux News 0 06-30-2007 01:16 AM
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration