Shop OBEX P1 Docs P2 Docs Learn Events
#include "simpletools.h" throws "No such file or directory" — Parallax Forums

#include "simpletools.h" throws "No such file or directory"

John KauffmanJohn Kauffman Posts: 653
edited 2013-09-11 17:37 in Propeller 1
#include "simpletools.h" throws compile error "No such file or directory"

I was under the impression that all the simplexxx.h were available without spec of path. But reference to it throws above error.
simpletools.h exists in C:\Users\John Kauffman\Documents\SimpleIDE\Learn\Simple Libraries\Utility\libsimpletools
I'm running (without modification) the Sense Light.c sample program form the Learn C tutorials: C:\Users\John Kauffman\Documents\SimpleIDE\Learn\Examples\circuits

Comments

  • mindrobotsmindrobots Posts: 6,506
    edited 2013-09-11 06:36
    John,

    I was having this problem yesterday after installing a new release on my Mac (I had installed and removed and reinstalled many of the early SimpleIDE releases during the Alpha testing). My solution was to make sure that the library folder field in the preferences panel pointed to Documents/SimpleIDE. That seemed to clear everything up for me.

    I just loaded and compiled Sense Light.c set up like this, so it is working for me currently.

    Hope this helps!
  • jazzedjazzed Posts: 11,803
    edited 2013-09-11 08:50
    Two key items must be set in the properties dialog for doing simple copy/paste #include "simpletools.h" to your code.

    1) The GCC Folders tab "Library Folder" must be set: I.E. C:/Users/Steve/Documents/SimpleIDE/Learn/Simple Libraries
    2) The General tab "Auto Include Simple Libraries" must be checked.

    These items should get set automatically in the latest package. You can check them by opening Properties.
    The Properties dialog can be opened using the tool-bar wrench, pressing F6, or selecting Menu -> Tools -> Properties.

    This information should be added to the User Guide.
  • Jeff MartinJeff Martin Posts: 758
    edited 2013-09-11 10:14
    #include "simpletools.h" throws compile error "No such file or directory"

    I was under the impression that all the simplexxx.h were available without spec of path. But reference to it throws above error.
    simpletools.h exists in C:\Users\John Kauffman\Documents\SimpleIDE\Learn\Simple Libraries\Utility\libsimpletools
    I'm running (without modification) the Sense Light.c sample program form the Learn C tutorials: C:\Users\John Kauffman\Documents\SimpleIDE\Learn\Examples\circuits

    John,

    In addition to the things already said, I'd like to verify that you renamed, moved, or deleted your original <user>\My Documents\Simple IDE\ folder path before starting the version of SimpleIDE you're using. If you do that, then start SimpleIDE, it will recreate that folder/file structure for you based on the latest Simple Library fileset included with the SimpleIDE install.

    Otherwise, you could be using older versions of the libraries that don't match the current capabilities of the software nor the current tutorials posted on our learn.parallax.com website.

    A near-future release of the software will make this set of steps more automatic and friendly.
  • altosackaltosack Posts: 132
    edited 2013-09-11 13:55
    What about using Simple Libraries from propgcc/Makefile (i.e., from the command line instead of SimpleIDE) ?

    I can get it to compile the files by including all the Simple Library subdirectories with -I as below, but the link step doesn't work. I have to include the whole directory up to and including /lmm as below (which breaks it if I want to switch easily between lmm an cmm, for example) in the -L, and it can find the library file, but it complains that it can't find the modules in the file.
    // In the following output, I formatted it to fit the screen; the propeller-elf-gcc commands are all on one line
    
    altosack@Saturn:~/Documents/RE/sys/t$ make
    propeller-elf-gcc -mlmm  -Os 
            -I"/home/altosack/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools" 
            -I"/home/altosack/Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext" 
            -I"/home/altosack/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c" 
            -m32bit-doubles -Dprintf=__simple_printf -Wall -c t.c -o t.o
    
    // no errors - it compiles OK with the above
    
    
    propeller-elf-gcc -mlmm 
            -L"/home/altosack/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/lmm" 
            -L"/home/altosack/Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext/lmm" 
            -L"/home/altosack/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/lmm" 
            -lm -lsimplei2c -lsimpletools -lsimpletext  t.o   -o t.elf
    
    t.o: In function `_main':
    (.text+0x48): undefined reference to `_print'
    t.o: In function `_main':
    make: *** [t.elf] Error 1
    

    For completeness, here's the input file (t.c) that generated the above:
    #include <stdio.h>
    #include "simpletools.h"
    
    int main(int argc, char * argv[])
    {
        print("Hello from Simple Libraries !\n");
    }
    


    If someone can help me make it work, I will help with whatever glue is necessary and document it for anyone else wanting to do such a thing.

    David Voss
  • jazzedjazzed Posts: 11,803
    edited 2013-09-11 14:23
    It may be a problem where the libraries have interdependencies. I won't have time to test this until tomorrow. Sorry.
  • KevinKKKevinKK Posts: 27
    edited 2013-09-11 15:02
    I also met same question as John did when I first installed SimpleIDE in my computer and it really took me several days on the thing. Finally, I can get through that by using "add SimpleIDE library" tool but not copy/paste. I really think it's not convenient for beginners.
  • jazzedjazzed Posts: 11,803
    edited 2013-09-11 15:40
    If you have followed the discussion and checked items described for SimpleIDE, and made sure you have a fresh copy of the workspace, then everything should work.

    If not, we need to understand why not.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-09-11 16:26
    What is the latest SimpleIDE version?
  • jazzedjazzed Posts: 11,803
    edited 2013-09-11 16:32
    SimpleIDE release packages are here:

    https://code.google.com/p/propside/downloads/list


    David (altosack)

    I found some free time ....

    You must add -l entries after the .c entry on the command line. For example:

    propeller-elf-gcc t.c -o t.elf -mcmm -Wall -m32bit-doubles -Os -I . -L . -I "/Users/steve/Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext" -L "/Users/steve/Documents/SimpleIDE/Learn/Simple Libraries/Text Devices/libsimpletext"/cmm -lsimpletext

    Here is a very simple Makefile.
    CC=propeller-elf-gcc
    MODEL=cmm
    
    SIMPLELIBS=/Users/steve/Documents/SimpleIDE/Learn/Simple Libraries
    SIMPLETEXT="$(SIMPLELIBS)/Text Devices/libsimpletext"
    
    all:
        $(CC) t.c -o t.elf -m$(MODEL) -Wall -m32bit-doubles -Os -I . -L . -I $(SIMPLETEXT) -L $(SIMPLETEXT)/$(MODEL) -lsimpletext
     
    
  • altosackaltosack Posts: 132
    edited 2013-09-11 17:37
    Thanks, jazzed, that works ! I was almost going to have to fire up SimpleIDE itself in order to make sure that there wasn't a problem with my Workspace installation. It's funny, I don't remember having to be concerned with -L being after the input file with gcc on a PC, but it's been a few years. By the way, it doesn't seem to be necessary with -I (the compiling pass); that was already working for me. It is necessary with -L during the linking phase, and that fixed it.

    Thanks also for the reminder about .../$(MODEL); I of course was already using $(MODEL) for other things in my Makefile, but it hadn't (yet) occured to me to apply it to the library search path.

    I promised a while back to write a tutorial on using a Makefile with propgcc development, but I never delivered. Maybe I'll look again at doing that, of course with a detractor in the beginning suggesting that most people would be happier with SimpleIDE (it just keeps getting better). I still have my reasons for using a Makefile, though.
Sign In or Register to comment.