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 \
-shared
# 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
GECKO_DEFINES = -DMOZILLA_STRICT_API -DIMYCOMPONENT_EXPORTS -DLINUX -g3
GECKO_INCLUDES = -I $(GECKO_SDK_PATH)/include
GECKO_LDFLAGS = -L $(GECKO_SDK_PATH)/lib -L $(GECKO_SDK_PATH)/bin
-L/usr/lib -lxpcomglue_s \
-lnspr4 \
-lplds4 -libmeci
FILES = MyComponent.cpp MyComponentModule.cpp
TARGET = libMyComponent.so
build:
$(CXX) -Wall -Os -o $(TARGET) $(GECKO_CONFIG_INCLUDE)
$(GECKO_DEFINES) $(GECKO_INCLUDES) $(GECKO_LDFLAGS) $(CPPFLAGS)
$(CXXFLAGS) $(FILES)
chmod +x $(TARGET)
clean:
rm $(TARGET)
Any suggestions would be greatly appreciated.
Susan
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom