XPCOM Component Built for FF 1.5 fails in Linux

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

XPCOM Component Built for FF 1.5 fails in Linux

I am attempting to build the sample XPCOM from the website:
http://www.iosart.com/firefox/xpcom/. It compiles, links, and executes in
Firefox 1.5 on a Windows XP platform, using the Gecko 1.8b1 libraries. On
Linux (Fedora Core 4), it compiles and links but an attempt to execute
this Javascript line (In Firefox 1.5):
obj = Components.classes[cid].createInstance();
fails with:
TypeError: Components.classes[cid] has no properties.
xpti.dat contains references to the component; compreg.dat does not. I
have run ldd on the shared library and there appear to be no outstanding
dependencies. This XPCOM was built with an earlier version of the Gecko
library, and ran successfully under Firefox 1.07 on the same system.
Here is the makefile.

CXX   = c++
CPPFLAGS +=     -fno-rtti              \
                -fno-exceptions        \
# Change this to point at your Gecko SDK directory.
GECKO_SDK_PATH = gecko-sdk-linux-1.8b1
# GCC only define which allows us to not have to #include mozilla-config
# in every .cpp file.  If your not using GCC remove this line and add
# #include "mozilla-config.h" to each of your .cpp files.
GECKO_CONFIG_INCLUDE = -include mozilla-config.h
-L/usr/lib -lxpcomglue_s \
                 -lnspr4      \
                 -lplds4  -libmeci

FILES = MyComponent.cpp MyComponentModule.cpp
TARGET = libMyComponent.so

        $(CXX) -Wall -Os -o $(TARGET) $(GECKO_CONFIG_INCLUDE)
        chmod +x $(TARGET)

        rm $(TARGET)

Any suggestions would be greatly appreciated.
dev-tech-xpcom mailing list
[hidden email]