static class members, shared libs and other vegetables



Hi All,

I'm trying to create a quick-and-dirty solution to a problem one of
our customer requires: one of the libs in our product needs to be
instantiated two times. The problem is that it contains many static
members.

Of course changing the static members to be non-static is the best
solution, unfortunately the code base is pretty big, and this would
require a lot of resources, which, unsurprisingly, we don't have.

Our first solution was to compile all libraries to a second set of
libraries, and load the two sets separately. This solution worked on
Windows, and we successful created two instances of every static
member in the system.

The solution doesn't work on Linux, as static members for some reason
are shared across the libraries, although the libraries are loaded
dynamically at the start of the program. Checking the library instance
I can see that we have different handles, and global variables are not
shared between the instances. Alas, static members in the classes are
shared which eliminates the suggested solution.

One way to solve this issue is, naturally, putting the code behind one
namespace, compiling it, changing the namespace and compiling the code
again. Unfortunately, this solution is too costly to implement since
the project contains a large number of files that should be changed.
In addition, this solution will be disposed of in the near future as
the static variables are removed.

Is there a quicker and dirtier way to solve this issue? Maybe some
script or switch to compile all code under a single namespace.

I'm desperate.

Maor

.



Relevant Pages

  • Re: Getting namespace errors on compile
    ... tshad wrote: ... when I compile but not in C# using the same libraries. ... PageInit.cs: error CS0138: A using namespace directive can only be applied ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Carrying Libraries on Your Back...
    ... > Why not build on an installed based of assemblies, ... > than porting libraries around, ... download source code ... compile local source against header files ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Using Lattice ispLEVER with VHDL libraries
    ... I am assuming there are some advantages to using the IDE rather than ... I also can't see to get Modelsim to work with ispLever, ... You will have to read about the tool you use to specify compile ... user defined libraries to get things to go under ispLever. ...
    (comp.arch.fpga)
  • Re: Getting started on the HP49g+
    ... either the original HP extable lib ... extable2 lib from http://www.hpcalc.org/details.php?id=3940. ... ask again if you have any problem installing libraries. ... compile the string with ASM (listed in the development lib menu, ...
    (comp.sys.hp48)
  • Re: <ctype.h> toLower()
    ... If it's a free standing implimentation, then the scope of the standard is ... > considering portability if makes a heck of a big difference.. ... the code you write will work on /any/ machine you compile it for (if ... the platforms provide the same libraries or even the same program entry ...
    (alt.comp.lang.learn.c-cpp)