There is a problem when building a static library under MSVC(7 or 8) and linking with the Producer DLL having to do with unresolved symbols and/or inconsistent dll linkage. By default, the Visual Studio IDE defines _LIB as a preprocessor when building a static lib. This however causes the PR_EXPORT and and OPENTHREAD_EXPORT_DIRECTIVE to be defined to be empty when it really should be __declspec(dllimport).
The way it is done in the OpenSceneGraph Export file looks to be correct. I think modifying the Producer and OpenThreads headers in this way shouldn't affect anything else, only if you want to build and link statically which AFAIK not many people do.
Ahh, the joys of Windows DLL's. I've gone through all of this myself and arrived at almost exactly the same solution as the OpenSceneGraph one.
Regards,
Chris
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# if defined( _LIB ) || defined( USE_STATIC )
# define PR_EXPORT
# elif defined( PR_LIBRARY )
# define PR_EXPORT __declspec(dllexport)
# else
# define PR_EXPORT __declspec(dllimport)
# endif /* PR_LIBRARY versus STATIC */
#else
# define PR_EXPORT
#endif
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
