Lars Gullik Bjønnes wrote: > Peter Kümmel <[EMAIL PROTECTED]> writes: > > | I've started to build shared libraries instead of static ones, > | because linking is so slow under windows. > | > | I only have successfully build the support library after > | some small file moving (from src to support). > | > | Then I've tried to do the same with controllers, but there are > | so much dependencies to the executable and to the frontend > | that I've given up. > | > | So my question: Which libraries could in principle be > | build as shared libraries? > > All om them should be possible. > > Your platform might give further restrictions. >
But I fear it is more complicated like it sounds. For instance, controllers calls several functions which are part of the executable, so I get linker errors, e.g: Kernel.obj : error "public: void Dialogs::disconnect(class ... Kernel.obj : error "public: bool BufferView::available(void)const " .. Kernel.obj : error "public: bool Buffer::isReadonly(void)const " .. Kernel.obj : error "public: class Buffer * LyXView::buffer(void)const "... This could only be solved by removing this calls from controllers (which seems impossible), or by creating a new library (base?) which does NOT depend on controllers, against controllers then could link. At the current stage the code is full of dependencies, and some circular could only be solved by moving functions into a other library. And how would it look like? Here a small part of my support changes to build a Dll: Index: package.h =================================================================== --- package.h (revision 14889) +++ package.h (working copy) @@ -15,6 +15,7 @@ #ifndef LYX_PACHAGE_H #define LYX_PACHAGE_H +#include "lyxexport.h" #include <string> namespace lyx { @@ -44,6 +45,7 @@ * @param command_line_user_support_dir, the LyX user dir, * as specified on the command line with "-userdir <path to dir>". */ +LYXSUPPORT_EXPORT void init_package(std::string const & command_line_arg0, std::string const & command_line_system_support_dir, std::string const & command_line_user_support_dir, @@ -52,9 +54,10 @@ /** Accessor to the global data. * Asserts that init_package() has been called first. */ +LYXSUPPORT_EXPORT Package const & package(); -class Package { +class LYXSUPPORT_EXPORT Package { public: /// Default constructor does not lead to the paths being set. Package(); Index: path.h =================================================================== --- path.h (revision 14889) +++ path.h (working copy) @@ -12,6 +12,7 @@ #ifndef PATH_H #define PATH_H +#include "lyxexport.h" #include <boost/utility.hpp> #include <string> @@ -32,7 +33,7 @@ * * At the end of p's scope the cwd is reset to its previous value. */ -class Path : boost::noncopyable { +class LYXSUPPORT_EXPORT Path : boost::noncopyable { public: /// change to the given directory Is there a chance that something like this could be checked in? If not I could spare my time. But supporting shared libraries is like another code cleanup, which makes the libraries more independent from another. -- Peter Kümmel