Re: Shared Library registration with regcomp
Rohit Kulkarni <[email protected]> Wed, 6 Apr 2011 12:35:05 +0530
| Newsgroups | gmane.comp.openoffice.dba.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, Thank you for your reply. I am able to solve the problem. Now my driver is there in the bootstrapdrivers() vector. Also in services.rdb with correct service names. The problem was that the file SServices.cxx from your odk/SkeletonDriver is old or wrong. I just edited that file according to other drivers services.cxx file. That means changing some data type names or commenting some variables etc.. So, I think you should update that file or may be SkeletonDriver in next openoffice source code. Thank you, Rohit On 4/6/11, Ocke Janssen <[email protected]> wrote: > Hi Rohit, > > I change and add some lines. > > On 05.04.2011 14:40, Rohit Kulkarni wrote: >> Hello, >> Thank you for your help. >> >> I understand what you are trying to tell me. >> I understand why I cant regcomp the lib file from connectivity module. >> Now can you please tell me what is wrong in my map file and makefile. >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D makefile.mk= <http://makefile.mk> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >> PRJ=3D..$/..$/.. >> PRJINC=3D..$/.. >> PRJNAME=3Dconnectivity >> TARGET=3DDriverSkeleton >> >> ENABLE_EXCEPTIONS=3DTRUE >> VISIBILITY_HIDDEN=3DTRUE >> >> # --- Settings ---------------------------------- >> .IF "$(DBGUTIL_OJ)"!=3D"" >> ENVCFLAGS+=3D/FR$(SLO)$/ >> .ENDIF >> >> .INCLUDE : $(PRJ)$/makefile.pmk >> .INCLUDE : $(PRJ)$/version.mk <http://version.mk> >> >> # --- Files ------------------------------------- >> SLOFILES=3D\ >> $(SLO)$/SResultSet.obj \ >> $(SLO)$/SStatement.obj \ >> $(SLO)$/SPreparedStatement.obj \ >> $(SLO)$/SDatabaseMetaData.obj \ >> $(SLO)$/SConnection.obj \ >> $(SLO)$/SServices.obj \ >> $(SLO)$/SResultSetMetaData.obj \ >> $(SLO)$/SDriver.obj >> >> SHL1VERSIONMAP=3D $(TARGET).map > Change to > SHL1VERSIONMAP=3D$(SOLARENV)/src/component.map >> >> # --- Library ----------------------------------- >> SHL1TARGET=3D$(TARGET)$(DLLPOSTFIX) >> SHL1OBJS=3D$(SLOFILES) >> SHL1STDLIBS=3D\ >> $(CPPULIB) \ >> $(CPPUHELPERLIB) \ >> $(TOOLSLIB) \ >> $(SALLIB) \ >> $(DBTOOLSLIB) \ >> $(COMPHELPERLIB) >> SHL1DEPN=3D >> SHL1IMPLIB=3D i$(TARGET) >> >> SHL1DEF=3D $(MISC)$/$(SHL1TARGET).def >> >> DEF1NAME=3D $(SHL1TARGET) >> DEF1EXPORTFILE=3D exports.dxp > >> >> # --- Targets ---------------------------------- >> >> .INCLUDE : $(PRJ)$/target.pmk > > Add these lines > ALLTAR : $(MISC)/skeleton.component > > $(MISC)/skeleton.component .ERRREMOVE : > $(SOLARENV)/bin/createcomponent.xslt \ > skeleton.component > $(XSLTPROC) --nonet --stringparam uri \ > '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ > $(SOLARENV)/bin/createcomponent.xslt skeleton.component > > Copy mysql.component to skeleton.component > > - oj >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >> >> Also my .map file is, >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3DDriverSkeleton.map=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> >> DRIVERSKELETON_2_0 { >> global: >> component_getImplementationEnvironment; >> component_writeInfo; >> component_getFactory; >> local: >> *; >> }; >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >> >> And exports.dxp is, >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3Dexports.dxp=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D >> component_getImplementationEnvironment >> component_writeInfo >> component_getFactory >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >> >> All above files are under " connectivity/source/drivers/DriverSkeleton " >> this path. >> Are above files are correct and if so what goes wrong ? >> Also, can you tell me what is the use of SServices.cxx file ? >> And what should I write below " SHL1STDLIBS=3D\ " this in makefile.mk >> <http://makefile.mk> ? >> >> Regards, >> Rohit >> >> 2011/4/4 Frank Sch=F6nheit <[email protected] >> <mailto:[email protected]>> >> >> Hi Rohit, >> >> > I am trying to register the library (.so) file for the example >> skeleton >> > sdbc driver using "regcomp" tool into the services.rdb file. When >> I try >> > to register the shared library in "connection/unxlngi6.pro/lib >> <http://unxlngi6.pro/lib> >> >> I suppose you mean "connectivity/unxlngi6.pro/lib >> <http://unxlngi6.pro/lib>" here, i.e. the local >> output tree of the "connectivity" module? >> >> > <http://unxlngi6.pro/lib>" directory it fails giving >> > "CannotRegisterImplementationException" exception. >> > >> > However during the build process this library is copied into >> > 'solver//330/unxlngi6.pro <http://unxlngi6.pro> >> <http://unxlngi6.pro>" directory and when I >> > try to register this file it succeeds ! >> > >> > Could anyone tell me what changes happen to the library files >> during >> > build process when they are copied into the solver directory? >> >> I suppose this is a LD_LIBRARY_PATH problem: your library is probably >> linked against other libraries from URE (the UNO runtime environment= ), >> which, in a complete build, also reside in >> $SOLVER/330/unxlngi6.pro/lib <http://unxlngi6.pro/lib>. >> So, if your library resides there, too, and your LD_LIBRARY_PATH >> contains ".", then loading the lib succeeds. Loading the lib in the >> local output tree doesn't succeed, since the loader doesn't find the >> URE >> libs there. >> >> To verify this, try "ldd <lib_name>" to see which libs your actual l= ib >> needs, and whether the loader finds them. >> >> > My problem is that the my sdbc driver library is supposed to >> implement >> > com.sun.star.sdbc.Driver service but when I register it from >> solver it >> > is implementing some strange services like >> > "com.sun.star.comp.svl.PathService" and >> > "com.sun.star.uno.util.numbers.SvNumberFormatterServiceObject" >> hence I >> > am wondering if something is changing the library during the >> build process. >> >> This means that you don't export the proper symbols from your librar= y, >> which most probably means your map file is wrong. Look into an other >> driver's makefile.mk <http://makefile.mk>, search for a directive >> referring to a file >> component.map, and copy this for your driver. >> >> Background: since your driver doesn't export the necessary >> "component_*" >> functions, which are looked by by the UNO component registration >> process, those functions are taken from another (random) library whi= ch >> your actual library links to. And those other functions, in your case >> obviously originating from the libsvl* library, write their very UNO >> component information. >> >> Note that what you're doing is a component with so-called active >> registration, which is deprecated. Passive registration is to be >> preferred nowadays, it means that instead of adding (active) code to >> your library which describes the UNO components it exports, you place >> an >> XML file near your lib, and describe the components therein. See >> >> http://wiki.services.openoffice.org/wiki/Passive_Component_Registration >> for details. >> >> This completely avoids the regcomp stuff, though at the moment, I am >> not >> sure how to integrate those passive registration into the >> build/deployment process. I think you can learn from other modules >> here, >> too - VCL comes to mind, look into vcl/util/vcl.component, and how it >> is >> used. >> >> HTH >> >> Ciao >> Frank >> -- >> ----------------------------------------------------------------- >> To unsubscribe send email to [email protected] >> <mailto:[email protected]> >> For additional commands send email to [email protected] >> <mailto:[email protected]> >> with Subject: help >> >> > > -- ----------------------------------------------------------------- To unsubscribe send email to [email protected] For additional commands send email to [email protected] with Subject: help