Shop OBEX P1 Docs P2 Docs Learn Events
Compiler can't find objects — Parallax Forums

Compiler can't find objects

T ChapT Chap Posts: 4,198
edited 2006-07-07 22:33 in Propeller 1
When experimenting with trying to reference various objects from a program, the only object that is found is TV. There are a number of objects in the library where they were installed, but no matter whether I lload an object into the editor or not, it still says can't find object.spin in editor tab, work folder or library. TV will compile though.

The program Serial_LCD.Spin will compile as is, which references Simple_serial.

All I did was add this to my program without writing any code that calls any of the objects methods:

OBJ

testit : "Serial_LCD" 'or sub any other object except TV

Comments

  • SSteveSSteve Posts: 808
    edited 2006-07-07 14:37
    The Propeller Tool will not look through open files for referenced objects (even though it implies it does). The Spin files have to either be in the Propeller Library folder or the same folder as your Top Object. If I remember correctly the "object not found" message tells you exactly which folders it's looking in. Just make sure the Spin file is in one of those two folders.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • Charlie JohnsonCharlie Johnson Posts: 147
    edited 2006-07-07 15:10
    Also, the 'Library' folder is not the one named 'Library' under the 'Examples' folder .... it is the top level folder 'Propeller Tool v0.95.1'
  • T ChapT Chap Posts: 4,198
    edited 2006-07-07 17:49
    Ok I looked in the main Propepper folder and what do you know, only TV was in that folder. Mr program is on the desktop only. So I dragged all the Library contents to the main Propeller folder and now my program(desktop) will compile with any object.

    Thanks for straightening that out.
  • Charlie JohnsonCharlie Johnson Posts: 147
    edited 2006-07-07 18:34
    Wow, I actully provided an answer that was correct. WooHoo
  • T ChapT Chap Posts: 4,198
    edited 2006-07-07 19:25
    There are a few remaining things to understand:

    1. I don't quite get what the Top Level is. I thought it was my main program, but then there is a button for Identify Top level...if it ws my main program, it wouldn't need to be identified


    2. Do variables and constants have to be declared ( and identical) to the oned required in the Object?

    3. If a Var or Con in an object to be referred to uses a pin that conflicts with your main program, do you simply plan around that objects pin assignment? If so, what if you are referencing several objects that even conflict themselves for pin assignment, do you have to rename/resave them with workable pin assignments?

    Thanks fellas
  • SSteveSSteve Posts: 808
    edited 2006-07-07 22:01
    1. The Top Object is indeed your main program, but you need to tell the Propeller Tool which is your main program. When you press F10 (etc.), the Tool will compile whichever window is frontmost (and all of the objects it references). When you press Ctrl-F10 (etc.), the Tool will compile your Top Object whether it's the front window or not.

    2. Each Object has its own separate and independent variables and constants. It's not like the multi-bank Stamps where all the banks share the same variable RAM.

    3. You are responsible for making sure that there's no pin conflict between your Top Object and the objects it references. The Tool can't do that for you. After all, there are situations where it is desirable for multiple objects to access the same pins (e.g. I2C).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • T ChapT Chap Posts: 4,198
    edited 2006-07-07 22:33
    Aha!
Sign In or Register to comment.