"Reference to unknown object: xxx" warning

Help requests on developing Logtalk applications

Moderator: Paulo Moura

Locked
rbt
Posts: 17
Joined: Tue Feb 09, 2010 10:21 am

"Reference to unknown object: xxx" warning

Post by rbt »

Currently, i'm trying to consider all logtalk compiler warnings. Unfortunately, I don't really understand some occurences of the "Reference to unknown object: xxx" warning. For example, take a look at the following compiler output:

Code: Select all

% /.../src/knowledge/.lgt_tmp/world_state.pl compiled 0.00 sec, 7,584 bytes
% /.../src/knowledge/.lgt_tmp/abstract_statement_prover.pl compiled 0.01 sec, 17,384 bytes

%         WARNING!  Reference to unknown object: world_state
%                   in object statement_prover, defined in file /.../statement_prover.lgt
As you can see at the first line, the world_state object has been successfully compiled. However, two lines below the compilers warns me that the object statement_prover references to an unknown object world_state. How is that possible?


Best Regards.

rbt

Parker
Posts: 33
Joined: Wed Feb 27, 2008 2:51 pm

Re: "Reference to unknown object: xxx" warning

Post by Parker »

Perhaps world_state isn't an object but some other entity such as a category. You need to provide more information.

Cheers,
Parker

Paulo Moura
Logtalk developer
Posts: 533
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: "Reference to unknown object: xxx" warning

Post by Paulo Moura »

Can you ensure that the "report" flag is set to "on" instead of "warnings" (the usual default) before loading your application and post the extended compilation log?
Paulo Moura
Logtalk developer

rbt
Posts: 17
Joined: Tue Feb 09, 2010 10:21 am

Re: "Reference to unknown object: xxx" warning

Post by rbt »

I think, I just found the problem. world_state -- or to be more precise now world_state(_) -- is a parametric object. I used

Code: Select all

:- uses(world_state).
in statement_prover instead of

Code: Select all

 :- uses(world_state(_)). 
Sorry, for being so blind.

Best,

rbt

rbt
Posts: 17
Joined: Tue Feb 09, 2010 10:21 am

Re: "Reference to unknown object: xxx" warning

Post by rbt »

However, I still have a question concerncing this warning. I have two (prototype) objects -- let's call them foo1 and foo2 -- that are "calling" each other. Is it possible to avoid the warning in this scenario?

Best,

rbt

Paulo Moura
Logtalk developer
Posts: 533
Joined: Sat May 05, 2007 8:35 am
Location: Portugal
Contact:

Re: "Reference to unknown object: xxx" warning

Post by Paulo Moura »

You can avoid the "unknown" object warning by setting the "unknown" compiler option to "silent". For example:

Code: Select all

| ?- logtalk_load([foo1, foo2], [unknown(silent)]).
This solution is used e.g. on the "reflection" example where the same problem arises.
Paulo Moura
Logtalk developer

Parker
Posts: 33
Joined: Wed Feb 27, 2008 2:51 pm

Re: "Reference to unknown object: xxx" warning

Post by Parker »

See also this thread: viewtopic.php?f=15&t=62

Locked