Snippets code from my daily experience

October 4, 2008

XPCOM components, extensions and Visual C++ Express

Filed under: extension,gecko,mozilla,vc++,xpcom — dafi @ 3:01 pm

I’ve written a little XPCOM component that worked immediately thanks to the good tutorial written by Mark Finkle.

The extension stopped to work when I’ve installed it on computer different from my development environment, the error in console was

Failed to load XPCOM component: c:\Documents and Settings\…

The solution was to statically link the C/C++ runtime and add msvcrt to nodefaultlib switch.

VC++ Express 2008 (or above??) users must set from Configuration Properties

  • C/C++ -> Code Generation -> Runtime Library = Multi-threaded (/MT)
  • Linker -> Input -> Ignore Specific Library = MSVCRT.LIB

Blog at

%d bloggers like this: