LinuxQuestions.org
Visit Jeremy's Blog.
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, 08: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, 02: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, 08:25 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

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

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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 10:09 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

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

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 05: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:35 PM
How can i copt the MYSQL Database to a other server (Database) halvorls Linux - Server 3 07-27-2008 10:19 PM
LXer: Visual MySQL Database Design in MySQL Workbench LXer Syndicated Linux News 0 06-12-2008 08: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 02:16 AM
Writing an app that uses a mysql database without installing mysql server? QtCoder Programming 4 08-09-2004 03:43 PM


All times are GMT -5. The time now is 10:19 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration