Discussion Forum

Library Files ( NEED HELP!!)

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Leto N/A
Posted
28-Aug-2002 05:05 GMT
Toolset
C51
New! Library Files ( NEED HELP!!)
Hello,
I'm trying to create my own library file and include it into my project

1)I've written two function in separate files abc.A51 and xyz.A51
2)These files contain only 1 functions each
abc() and xyz() respectively
2)Then I created a project called "MyLib"
3)Then I included both abc.A51 and xyz.A51 in the project
4)Then I compiled it to a "library"
5)So I obtained the library file MyLib.lib and also abc.obj, xyz.obj
6)Now I create another project "MyProj" and a main.c file

My question is how do I include the library file MyLib.lib into this main.c file in the new project?
Note that originally my function was in assembly... so i didnt have header file for function prototype.
Also, If my main.c file uses only one of the functions ( example abc() ) will my final object file take less space compared to if i used both the functions ( abc() and xyz() )

Thank You
Read-Only
Author
Andrew Neil
Posted
28-Aug-2002 09:57 GMT
Toolset
C51
New! RE: Library Files ( NEED HELP!!)
"how do I include the library file MyLib.lib into this main.c file in the new project?"

You don't.

You include the library in the Project using the same 'Add File to Group' dialogue that you used for the main.c file - but select 'Library' as the file type

"i didnt have header file for function prototype."

You will need to create one!

"If my main.c file uses only one of the functions ... will my final object file take less space compared to if i used both the functions"

Yes - that is the whole point of a Library!
Read-Only
Author
Leto N/A
Posted
29-Aug-2002 03:43 GMT
Toolset
C51
New! RE: Library Files ( NEED HELP!!)
Thank You!! :D
Read-Only
Author
Walt Conley
Posted
27-Jan-2003 20:08 GMT
Toolset
C51
New! RE: Library Files ( NEED HELP!!)
Here are a couple links that may answer your questions.

http://www.keil.com/support/docs/2113.htm
http://www.keil.com/forum/docs/thread1779.asp

Read-Only
Author
Walt Conley
Posted
27-Jan-2003 20:09 GMT
Toolset
C51
New! RE: Library Files ( NEED HELP!!)
Sorry I replied to the wrong thread.

Next Thread | Thread List | Previous Thread Start a Thread | Settings