Hello Andreas,

Andreas Halm wrote:
> Thanks for your time. I hoped it would be something simple, something
> someone else has already stumbled upon ...

hm, it's a linker error on windows, those tend to be more on the nasty 
side in my experience ;)

> But did anybody ever try this? My FC-derived classes are in a Lib which is
> then statically linked to the app, but the OpenSG DLLs are dynamically
> linked.

not sure, I've not tried to build static libs before. Is it necessary 
that you go this route?

> I don't quite understand why the error message says something about
> missing dllimport, that just doesn't make sense.

oh, wait, sorry for not picking up on this earlier: the class 
annotations are set up so that they are either __declspec(dllexport) or 
__declspec(dllimport) depending on whether OSG_COMPILE<LIBNAME>LIB is 
defined or not.
You probably have a OSGMyLibDef.h file that defines a 
OSG_MYLIB_DLLMAPPING macro? I guess it should be defined to nothing if 
you are going to build a static MyLib.lib then?

> However, I tried explicit template instantiation like this:
> 
> #define OSG_INSTANTIATE_PTR(CLASST) \
>     template class TransitPtr   < CLASST                  > ;    \
>     template class MTRefCountPtr< CLASST,                        \
>                                   NoRefCountPolicy        > ;    \
>     template class RefCountPtr  < CLASST,                        \
>                                   RecordedRefCountPolicy  > ;    \
>     template class RefCountPtr  < CLASST,                        \
>                                   UnrecordedRefCountPolicy> ;    \
>     template class RefCountPtr  < CLASST,                        \
>                                   WeakRefCountPolicy      > ;    \
>     template class MTRefCountPtr< CLASST,                        \
>                                   RecordedRefCountPolicy  > ;    \
>     template class MTRefCountPtr< CLASST,                        \
>                                   WeakRefCountPolicy      > ;         
> 
> OSG_BEGIN_NAMESPACE
> OSG_INSTANTIATE_PTR(Type1)
> OSG_END_NAMESPACE

ok, but wasn't the original error about 
OSG::PointerMFieldBase::operator[] ?

> Which interestingly doesn't compile and complains about it could not deduce
> a template argument. See OSGRefCountPolicies.h, struct NoRefCountPolicy,
> line 198:
> 
>     template<class T, class U>
>     static void convertTransitPtr(T *&pOut, T *&pIn)
>     {
>         OSG_ASSERT(false);
>     }
> 
> Is that really correct, or should it be U*& pIn ?

yes, you are right, thanks. Since this is normally never instantiated it 
was not noticed.

        Cheers,
                Carsten

------------------------------------------------------------------------------
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

Reply via email to