Jump to content
Sign in to follow this  
robertowong

making and using libraries

Recommended Posts

Guest Pavel

You need to use the -lib compiler command line option either by starting the compiler from command line or using the "Extra" field in the SourceBoost "Options" dialog.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Pavel,

 

I tried with the extra field , and it did not work . Then I tried with the command line and it worked fine .

Then when I tried to use the library in a c2c project , I added the library to the project ( in the workspace ) , but at compile time the library fails , the output window is giving me to many "Error : General error" messages .

Wath is the rigth way of doing this .

 

Thanks,

Roberto Wong.

Share this post


Link to post
Share on other sites
Guest Pavel

Just tried to do it myself using the flash sample code:

 

1. Created a project that included flash.c and flash.h files

2. Set -lib option into the Extra field

3. Compiled. No errors.

4. The library was generated but the library file had extension .asm. Changed extension to .lib

5. Created a new project that included flashtst.c, flash.lib and flash.h files.

6. Built and ran code under built-in simulator. No problems.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Pavel,

 

I tried with the flash sample and everything is ok , but the mine does not work . In my library , I am using functions that are not externals , I do not know if this is the source of the problem .

 

Thanks,

Roberto Wong

Share this post


Link to post
Share on other sites

I took a working project where I include the header file for my LCD driver code and copied the .c and .h files to a new directory and made a project including them. I used the -lib command in the extra field to successfully compile the project. I renamed the .asm to a .lib, it was 11kb. I then went back to the original project (where I got the LCD driver files), removed them and included the .lib file. It won't compile. I then looked at the .lib file and all it contained was C2C STX??

Share this post


Link to post
Share on other sites
Guest Pavel
I took a working project where I include the header file for my LCD driver code and copied the .c and .h files to a new directory and made a project including them. I used the -lib command in the extra field to successfully compile the project. I renamed the .asm to a .lib, it was 11kb. I then went back to the original project (where I got the LCD driver files), removed them and included the .lib file. It won't compile. I then looked at the .lib file and all it contained was C2C STX??

Did you include the library .h file into you project sources? What kind of errors have you got?

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...