Hi,
I do have an additional question. I have created my own contrib library and
added some files to it:
source/Contrib/CMakeLists.txt
source/Contrib/CMakeLists.Lib.OSGContribDataSolid.txt
source/Contrib/OSGContribDataSolidDef.h
source/Contrib/FileIO/OSB/OSGOSBHandleEntAttachment.h
source/Contrib/FileIO/OSB/OSGOSBHandleEntAttachment.cpp
What I have generally in mind is to collect my extensions of OpenSG 2.0 in a
separate library controlled by the OpenSG cmake project. However, that is
actually not the problem.
The OSGOSBHandleEntAttachment.h file looks something like the following
#include "OSGConfig.h"
#include "OSGContribDataSolidDef.h"
#include "OSGOSBCommonElement.h"
#include "OSGOSBElementFactoryHelper.h"
#include "OSGGeoToEntityAttachmentFields.h"
#include "OSGSysMFields.h"
OSG_BEGIN_NAMESPACE
class OSG_CONTRIBDATASOLID_DLLMAPPING OSBHandleEntAttachment : public
OSBCommonElement
{
...
};
...
and the implementation does contain the following statement
OSBElementRegistrationHelper<OSBHandleEntAttachment>
OSBHandleEntAttachment::_regHelper =
OSBElementRegistrationHelper<OSBHandleEntAttachment>("GeoToEntAttachment");
where "GeoToEntAttachment" is my old attachment and "GeoToEntityAttachment"
is the new one. Actually, until now I did not implement real code but build
up the boilerplate code.
Now, my problem is the following error message I alway get on compilation of
the OSGGeoToEntityAttachmentBase.cpp file (independently whether I use the
contrib library path or add the files directly into my application code):
>OSGGeoToEntityAttachmentBase.cpp
>d:\_graphic\comp\intern\opensg\source\system\fileio\osb\OSGOSBElementFactoryHelper.inl(68)
>
>: error C2491:
>'OSG::OSBElementRegistrationHelper<ElementTypeT>::OSBElementRegistrationHelper'
>
>: definition of dllimport function not allowed
>d:\_graphic\comp\intern\opensg\source\system\fileio\osb\OSGOSBElementFactoryHelper.inl(96)
>
>: error C2491:
>'OSG::OSBDefaultElementRegistrationHelper<ElementTypeT>::OSBDefaultElementRegistrationHelper'
>
>: definition of dllimport function not allowed
So, I think I'm missing something but can't get it right. What am I doing
wrong? Is it not possible to add a class derived from OSBCommonElement into
another library context?
As ever, any help is appreciated.
Kind regrads,
Johannes
"Johannes Brunen" <[email protected]> schrieb
im Newsbeitrag news:[email protected]...
> Hello Carsten,
>
> I'm back to this problem and need some more information.
>
> "Carsten Neumann" <[email protected]> schrieb
> im Newsbeitrag
> news:[email protected]...
>>
>> you can extend the OSB loader to have some special handling of old
>> classes instead of just using the default code path for your attachment.
>> We use this for example to convert TextureChunk to a pair of
>> TextureObjChunk and TextureEnvChunk.
>>
> Am I correct that this does automatically imply that I need to write a new
> attachment class, or is there a way to reuse the old class carrying a
> modified field type?
> Do I have to write some OSGOSBHandleMyAttachment class derived from
> OSBCommonElement? What are the tasks I do have to solve?
>
>>
>> One thing that is a bit tricky about the OSB loader is the way pointers
>> are stored/handled. On disc a pointer is stored as the id of the
>> pointed-to container, when loading a map between on-disc ids and system
>> ids is built and for each pointer field a data structure with the on
>> disc ids is filled. After loading the on disc ids are resolved to system
>> ids and the pointer fields of the containers are filled with the correct
>> values.
>> Please let me know if you need more info on the OSB loader and/or how to
>> extend it to handle your case.
>>
> Yes, some background information would be helpful in this context.
>
> Any help is really appreciated.
>
>
> Best,
> Johannes
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day trial. Simplify your report design, integration and deployment -
> and focus on what you do best, core application coding. Discover what's
> new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users