Am trying to use dev-cpp IDE on Windows 98 to create a c++ xpcom
component. Done most of the http://www.iosart.com/firefox/xpcom/
tutorial, however when attempting to link get an undefined external
(_imp___Z20NS_NewGenericModule2P12nsModuleInfoPP9nsIModule).

Code listed below and also nm output.

Any explanations and / or suggestions would be gratefully received,


Peter Whitefield

################################# linking
C:\Dev-Cpp\projects\mycomponent>c:\dev-cpp\bin\dllwrap.exe --output-def
libMyCom
ponent.def  --driver-name c++  --implib libMyComponent.a  MyComponent.o
MyCompon
entModule.o  -L"C:/DEV-CPP/lib" -L"C:/Dev-Cpp/projects/gecko-sdk/lib"
--no-expor
t-all-symbols --add-stdcall-alias
C:/Dev-Cpp/projects/gecko-sdk/lib/xpcomglue_s.
lib C:/Dev-Cpp/projects/gecko-sdk/lib/xpcom.lib  -o MyComponent.dll
C:\DEV-CPP\BIN\DLLWRAP.EXE: no export definition file provided.
Creating one, but that may not be what you want
MyComponentModule.o(.text+0x15b):MyComponentModule.cpp: undefined
reference to `
_imp___Z20NS_NewGenericModule2P12nsModuleInfoPP9nsIModule'
collect2: ld returned 1 exit status
C:\DEV-CPP\BIN\DLLWRAP.EXE: c++ exited with status 1
################################## code
C:\Dev-Cpp\projects\mycomponent>type mycomponentmodule.cpp
#include "nsIGenericFactory.h"
#include "MyComponent.h"

NS_GENERIC_FACTORY_CONSTRUCTOR(MyComponent)

static nsModuleComponentInfo components[] =
{
    {
       MY_COMPONENT_CLASSNAME,
       MY_COMPONENT_CID,
       MY_COMPONENT_CONTRACTID,
       MyComponentConstructor,
    }
};

NS_IMPL_NSGETMODULE("MyComponentsModule", components)

C:\Dev-Cpp\projects\mycomponent>
######################################## object code
C:\Dev-Cpp\projects\mycomponent>nm mycomponentmodule.o
00000000 b .bss
00000000 d .data
00000000 i .drectve
00000000 r .gcc_except_table
00000000 r .rdata
00000000 t .text
         U ___gxx_personality_sj0
         U __imp___Z20NS_NewGenericModule2P12nsModuleInfoPP9nsIModule
         U __Unwind_SjLj_Register
         U __Unwind_SjLj_Resume
         U __Unwind_SjLj_Unregister
00000000 t [EMAIL PROTECTED]
         U __ZdlPv
         U __ZN11MyComponentC1Ev
         U __Znwj
00000000 d _components
00000038 d _gModuleInfo
00000146 T _NSGetModule

C:\Dev-Cpp\projects\mycomponent>

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to