Libraries

I have been off and on attempting to make a library using the formula in the learn prop c. I cannot get it to work. Copied and pasted or hand typed. Can't get the library to link with the test program.
Is there something I'm missing?

Comments

  • 6 Comments sorted by Date Added Votes
  • Be sure to compile using the "Make Project Library" option.
    Be sure the library files are stored in the Simple Libraries path.
    To include the library in your project you may need to use the "project" command to add the library to your project.

    The thread below has details of how I built an SPI library with guidance from the forum experts.

    forums.parallax.com/discussion/157441/can-spi-in-simple-libraries-be-speeded-up/p3

    Tom
  • I will look at that, Thanks. I followed the steps above and the files are there. I will go to the link you provided and see what's up.
    Thanks.
  • Pilot,

    Were you able to figure out the issue you were having? I'm having the same problem with a library of my own.

    Thanks,
    David
  • Sorry have not been in the forums for a while.
    Not able to figure it out yet. I am letting it rest for a
    while. Working on another part of the project.
    Thanks
  • One thing that caught me off-guard was that the first file in your project is not included in the library archive. So, make sure the first file in your SimpleIDE project isn't supposed to be in the library (like a C file with just an empty main function).
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • There are 3 files (minimum) that are needed for a library to compile correctly.
    1. libxyz.c : contains the "unit test" code main() for the library and only uses the xyz_ functions.

    2. xyz.c : contains the xyz_ functions (no main) and global data if any. (There can be more than 1 file)

    3. xyz.h : contains the structure and other type definitions, forward function declarations, and documentation for the functions.

    The library tutorial shows how to make these files in SimpleIDE and compile them into a library. When I made my libspiasm, I did not lose any files.

    Tom
Sign In or Register to comment.