私は、LinuxオペレーティングシステムでFirefox 3.6.13用のシンプルなXPCOMコンポーネントを構築しようとしています。 Xulrunner SDK 1.9.2.13を使用してコンポーネントを正常にコンパイルしました。私はcomponentsディレクトリの下に置いていました。しかし、私は起動時に、私のFirefox FirefoxのコンソールがエラーFirefoxがFedoraでXPCOMコンポーネントをロードしていない
は「XPCOMコンポーネントのロードに失敗しましたを示しています。 /home/mypc/.mozilla/firefox/cxsm79p6.default/extensions/{1280606b-2510-4fe0-97ef-9b5a22eafe80を}このリンクhttps://developer.mozilla.org/en/Troubleshooting_XPCOM_components_registrationを参照することで
を/components/MyComponent.so、私は「Linux固有のヒント」をタイトルの下の指示に従いました。リンク中に特殊なリンク時間オプション-Wl,-z,defs
を使用すると言われています。だから私は、これらのオプションを追加しましたが、今
make: Warning: File `Makefile' has modification time 0.25 s in the future
cとその示すエラーをコンパイル中++ -Os -Wall -o MyComponent.so -include XPCOM-config.hの-DXPCOM_GLUE_USE_NSPR -Iを/ mnt/hgfsディレクトリ/ C /ユーザー/ sunil/SDKS/LINUX/xulrunner-sdk/include -I./ -L/mnt/hgfs/C /ユーザー/ sunil/SDKS/LINUX/xulrunner-sdk/lib -lxpcomglue_s -lxpcom -lnspr4 -fno -rtti -fno-例外-shared -Wl、-z、DEFS MyComponent.cpp MyComponentModule.cpp /tmp/ccMGUTql.o:機能で
MyComponent::QueryInterface(nsID const&, void**)': MyComponent.cpp:(.text+0x9b): undefined reference to
NS_TableDrivenQI(ボイド*、QITableEntry のconst *、NSIDのconstの&ボイド**) ' /tmp/ccbkZLTz.o:機能でNSGetModule': MyComponentModule.cpp:(.text+0x15): undefined reference to
NS_NewGenericModule2(nsModuleInfo constが*、nsIModule * ')collect2は:LD は1つの終了ステータスメイクが返されました:* * [ビルド]エラー1CXX = c++ CPPFLAGS += -fno-rtti \ -fno-exceptions \ -shared \ -Wl,-z,defs # Change this to point at your Gecko SDK directory. GECKO_SDK_PATH =/mnt/hgfs/C/Users/sunil/SDKS/LINUX/xulrunner-sdk # 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 xpcom-config.h GECKO_DEFINES = -DXPCOM_GLUE_USE_NSPR GECKO_INCLUDES = -I $(GECKO_SDK_PATH)/include GECKO_LDFLAGS = -L $(GECKO_SDK_PATH)/lib -lxpcomglue_s -lxpcom \ -lnspr4 FILES = MyComponent.cpp MyComponentModule.cpp TARGET = MyComponent.so build: $(CXX) -Os -Wall -o $(TARGET) $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) -I./ $(GECKO_LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(FILES) chmod +x $(TARGET) strip $(TARGET) clean: rm $(TARGET)
を次のように
私の新しいメイクファイルがある誰かが私はこの問題を回避を助けることはできますか?