Problem making and using SimpleIDE library

twm47099twm47099 Posts: 581
edited November 20 in Propeller 1 Vote Up0Vote Down
I used the instructions in the "Propeller C Library Studies" learn.parallax.com/tutorials/language/propeller-c/propeller-c-library-studies to build a library from the servo360 driver that I had ported from spin to C (posted here).
forums.parallax.com/discussion/comment/1425301/#Comment_1425301

When running the "test harness" program from the Simple Libraries/My Libraries/libservo360a folder, I get errors during "building" until I use the "open Tab to project" command in the "project" menu and open the "servo360a.c" and "FourPly.spin" files that are located in the folder. (The c file contains the library functions, and the spin file has the PASM driver).

I had previously built another library that worked well (libspiasm) as well as the ones in the tutorial, and as long as I had the relevant ".h" file in an #include statement in the program that uses the library functions, they worked without having to manually add the files to the project.

Since SimpleIDE doesn't allow opening tabs of files that exist in folders that are different than the one used for the project, that would require copying the library files to the folder containing the project.

I've attached a zip that contains the library files and the CMM folder that should contain the compiled library. The test harness file is "libservo360driver.side". "servo360.c" is the file with the library functions and "servo360.h" is the header file.

I am using SimpleIDE version 1.1 although I also tried it on an earlier version (1.02.RC2).

Any ideas?

Thanks
Tom

Comments

  • 3 Comments sorted by Date Added Votes
  • twm47099twm47099 Posts: 581
    edited November 20 Vote Up0Vote Down
    This is the error message I get when I try to build the program, where the Project and C program in in a "My Projects" folder and the library files are in the library folder where they were made.

    Project Directory: C:/Users/tandj/Documents/SimpleIDE/My Projects/servo360/
    
    SimpleIDE Version 1.1.0
    C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/
    C:/Users/tandj/Documents/SimpleIDE/ Updated on: 2017-11-18
    
    propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
    openspin.exe -c -I C:/Program Files (x86)/SimpleIDE/bin/../propeller-gcc/spin/ -o cmm/FourPly.dat FourPly.spin
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.78 Compiled on May 28 2016 12:06:45
    Compiling...
    FourPly.spin
    Done.
    Program size is 812 bytes
    propeller-elf-objcopy -I binary -B propeller -O propeller-elf-gcc --redefine-sym _binary_cmm_FourPly_dat_start=_binary_FourPly_dat_start --redefine-sym _binary_cmm_FourPly_dat_end=_binary_FourPly_dat_end --redefine-sym _binary_cmm_FourPly_dat_size=_binary_FourPly_dat_size cmm/FourPly.dat cmm/FourPly_firmware.o
    propeller-elf-gcc.exe -I . -L . -I ./../../Learn/Simple Libraries/My Libraries/libservo360a/cmm -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/My Libraries/libservo360a -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/My Libraries/libservo360a/cmm/ -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 -c servo360a.c -o cmm/servo360a.o
    
    propeller-elf-gcc.exe -I . -L . -I ./../../Learn/Simple Libraries/My Libraries/libservo360a/cmm -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -I C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/My Libraries/libservo360a -L C:/Users/tandj/Documents/SimpleIDE/Learn/Simple Libraries/My Libraries/libservo360a/cmm/ -o cmm/test2 (1).elf -Os -mcmm -m32bit-doubles -fno-exceptions -std=c99 cmm/FourPly_firmware.o cmm/servo360a.o test2 (1).c -lm -lsimpletools -lsimpletext -lsimplei2c -lservo360a -lm -lsimpletools -lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm -lsimpletools -lm
    c:/program files (x86)/simpleide/propeller-gcc/bin/../lib/gcc/propeller-elf/4.6.1/../../../../propeller-elf/bin/ld.exe: cannot find -lservo360a
    collect2: ld returned 1 exit status
    Done. Build Failed!
    
    

    I also tried to "Add Simple Library" to the project using the button in the Project menu. I clicked on the "My Libraries/libservo360a" folder and got the following error: "CMM Memory Model Library not found in (and it shows the path to My Libraries/libservo360a). I have attached the file listing from the libservo360a/cmm folder which has library files.

    I also tried "Add Simple Library" to a library I had created using SimpleIDE version 0.9.45 and that added without an error.

    Based on this I question if there is a problem with the current version of Simple IDE creating a project library even when that box is checked in the project manager linker tab. The files are created in the Memory Model folder, but they aren't then recognized as libraries.

    There was only a problem with my current memory -- see posts below.

    Help

    Thanks
    Tom
  • maccamacca Posts: 185
    edited November 20 Vote Up0Vote Down
    twm47099 wrote: »
    This is the error message I get when I try to build the program, where the Project and C program in in a "My Projects" folder and the library files are in the library folder where they were made.

    Can't help much with that, but -lservo360a expects a library file named libservo360a.a and in your directory listing you don't have that file, you have libservo360driver.a, you need to change the library name so it compiles to libservo360a.a.
  • twm47099twm47099 Posts: 581
    edited November 20 Vote Up0Vote Down
    @macca
    Thank you. I re-saved the project that generated the library as "libservo360a.side" and re built the library. It worked.

    I need to make better notes when I get something to work.

    Thanks again,
    Tom
Sign In or Register to comment.