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?<>>>>>>>>>>,,, |
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. |
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 |
What error message do you get when you try compiling?
|
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 ....???????. |
All times are GMT -5. The time now is 06:46 AM. |