LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-14-2004, 05:05 AM   #1
gauravsahni
LQ Newbie
 
Registered: Sep 2004
Location: india
Posts: 8

Rep: Reputation: 0
Angry not able to include archived C library into my program


i have a main program in which i want to tinclude different archieves C library for example

/root/kerb/src/lib/krb5/
the above directory contains libkrb5.a archieved library (which contains around 300 object files)

/root/kerb/src/lib/krb5/lib/krb
the above directory contains libdes.a archieved library

similary there are many archived library distributed accross different directories i want ot include these libraries into my main program how to do that .
my main program is at the following path

/root/client/main.c

probaaly i have to write a make file to include the above iam not able to do that
can some body send me sample make file to include the above two libraries as an example ...
plz help because i am at the do or die situation?<>>>>>>>>>>,,,
 
Old 11-14-2004, 05:11 AM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
Try:

cd /root/client; gcc main.c /root/kerb/src/lib/krb5/libkrb5.a /root/kerb/src/lib/krb5/lib/krb/libdes.a

That should create a file /root/client/a.out with those 2 libraries linked statically.
 
Old 11-14-2004, 05:40 AM   #3
gauravsahni
LQ Newbie
 
Registered: Sep 2004
Location: india
Posts: 8

Original Poster
Rep: Reputation: 0
Angry tried :the option you provided still not working

thanks for repling to my post but i have tried that its not working moreover there is no output file created such as a.out
i want a different executabe to be creeted with name "client" not the a,out.
what if ihave to write a make file for that because everytime i cannot provide such a long gcc command everytime morover ihave to link 8 such liberies into my project. plz help
 
Old 11-14-2004, 06:28 AM   #4
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
What error message do you get when you try compiling?
 
Old 11-15-2004, 02:30 AM   #5
gauravsahni
LQ Newbie
 
Registered: Sep 2004
Location: india
Posts: 8

Original Poster
Rep: Reputation: 0
Question undefined reference to the fucntion

like if there is a function krb5_get_timestamp it the library libkrb5.a then it says undefined reference to the above function moreover in the existing projects there is no such error

and no a.out file is being generated


moreover i have to generate and exe file wiht the name client and every time when i make change to library i cannot give the path for each and every library i have to write the make file can you help me in that ....???????.
 
  


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
How to change the library used by a program. wangjinyi Fedora 1 11-23-2005 10:31 AM
ANSI C: Math library making #include unnecessary? olspookishmagus Programming 3 11-01-2005 09:50 AM
How to include library directories? davee Programming 7 04-05-2004 05:41 AM
include a library in program calble Programming 1 10-09-2003 12:59 PM
Include and library path problem sadeer Linux - Software 1 11-07-2002 02:35 AM


All times are GMT -5. The time now is 03:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration