Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

following iosart tutorial, Components.classes[cid] has no properties

9 views
Skip to first unread message

Ian Malone

unread,
Nov 23, 2006, 5:11:21 AM11/23/06
to dev-tec...@lists.mozilla.org
Hi,

(Using Linux, Fedora Core 5, Firefox 1.5.0.8,
mozilla-devel-1.7.13-1.1.fc5)

I'm trying to start creating XPCOM components using the
tutorial at <http://www.iosart.com/firefox/xpcom/>. After
adjusting paths in the Makefile so everything in the
example source builds, I copy the .xpt and .so to
/usr/lib/firefox-1.5.0.8/components, delete xpti.dat and
compreg.dat from my profile and restart Firefox. On running
the example Javascript I get the error:
"Components.classes[cid] has no properties"

>From the iosart page I can see that this happens if:
1. On Windows you have built the component against a
different runtime to Gecko.
or
2. You have not copied the .so and .xpt files to the
components directory.
[ian@atlas src]$ ls
/usr/lib/firefox-1.5.0.8/components/{MyComponent.so,IMyComponent.xpt}
/usr/lib/firefox-1.5.0.8/components/IMyComponent.xpt
/usr/lib/firefox-1.5.0.8/components/MyComponent.so

Neither of the above applies.
If I grep for MyComponent:
[ian@atlas src]$ grep -i mycomponent
~/.mozilla/firefox/sz2obw1x.default/xpti.dat
127,IMyComponent.xpt,0,139,1164241019000
246,IMyComponent,{90758a97-a6f3-4ea4-8953-16bd2ee3a977},127,-1,1

but
[ian@atlas src]$ grep -i mycomponent
~/.mozilla/firefox/sz2obw1x.default/compreg.dat
[ian@atlas src]$

Is there anything else I can try to get this to work?

--
imalone

Christian Biesinger

unread,
Nov 24, 2006, 11:53:03 AM11/24/06
to dev-tec...@lists.mozilla.org
Ian Malone wrote:
> Is there anything else I can try to get this to work?

Try compiling your component with the -Wl,-z,defs option (or,
equivalently, -Wl,--no-undefined) to make sure that you have no
unresolved references. Also make sure that you are linking against the
correct XPCOM glue library.

Hope this helps,
-christian

--
All the world's a stage,
And all the men and women merely players:
They have their exits and their entrances;
And one man in his time plays many parts, [...] --W. Shakespeare

Ian Malone

unread,
Nov 24, 2006, 3:09:23 PM11/24/06
to dev-tec...@lists.mozilla.org
Christian Biesinger wrote:
> Ian Malone wrote:
>> Is there anything else I can try to get this to work?
>
> Try compiling your component with the -Wl,-z,defs option (or,
> equivalently, -Wl,--no-undefined) to make sure that you have no
> unresolved references. Also make sure that you are linking against the
> correct XPCOM glue library.
>

You were right (permanent record=good idea). The issue was
that the link options in the iosart makefile came before
the source files and so libxpcomglue from the SDK was not
being linked. I'm now finding new and interesting things
to break instead.

I've posted this solution to the iosart site, where it's
sitting at the bottom of about 50 other comments.

--
imalone

0 new messages