DLL Hell(p)

Discussion in 'C++' started by Al A. Palooza, Jan 15, 2005.

  1. Hi, I'm having some problems with DLLs (using C++, so it's on topic). Can
    someone help me?

    The problem is this: I have a common-functionality DLL, and an EXE. The EXE
    uses the DLL. But both the DLL and the EXE use a basic static library which
    implements a memory manager.

    The memory manager class has a singleton instance, s_pInstance. This is a
    static member of the memory manager class. To access the memory manager the
    user calls MemMgr::Get (a static function).

    Seems pretty straightforward. But because both the DLL and the EXE use the
    LIB, both need to have copies linked to them at build time. This results in
    two copies of the same library in memory. So when one calls MemMgr::Get it
    gets a different pointer from the other, resulting in crashes (I only set
    the pointer once).

    Is there a way to work around this that doesn't completely suck? The only
    way I can think of is to pass a common memory manager pointer from one of
    the clients to the other, but this breaks the anonymity and extenstion I was
    trying to achieve - plus just hides the fact that both are statically linked
    to a library that I only need one instance of.

    The other solution would be to make the static library a DLL but since it
    doesn't _need_ to be dynamically loaded it seems kind of a waste.

    Any ideas?
    Al A. Palooza, Jan 15, 2005
    #1
    1. Advertising

  2. go to windows.programming group... we only deal with the standard.
    puzzlecracker, Jan 15, 2005
    #2
    1. Advertising

  3. Al A. Palooza

    Mike Wahler Guest

    Re: [OT, welcome msg, redir] DLL Hell(p)

    "Al A. Palooza" <> wrote in message
    news:...
    > Hi, I'm having some problems with DLLs


    DLL's are not part of C++, but a feature of the Microsoft
    Windows operating system, and can be written in virtually
    any language.

    > (using C++, so it's on topic).


    No it's not. Please see:
    http://www.slack.net/~shiva/welcome.txt

    > Can
    > someone help me?


    Not here.

    Try comp.os.ms-windows.programmer.win32

    -Mike
    Mike Wahler, Jan 15, 2005
    #3
  4. Al A. Palooza

    Jack Klein Guest

    On Fri, 14 Jan 2005 23:16:53 -0500, "Al A. Palooza" <>
    wrote in comp.lang.c++:

    > Hi, I'm having some problems with DLLs (using C++, so it's on topic). Can

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    No, it's not. The language does not define DLLs, static or dynamic
    libraries, or interactions that arise out of that choice.

    > someone help me?


    Yes, people in a group that supports your particular compiler/os
    combination, or a Windows programming group like
    news:comp.os.ms-windows.programmer.win32.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Jan 15, 2005
    #4
  5. Al A. Palooza

    GTO Guest

    > Is there a way to work around this that doesn't completely suck?

    Yes. Switch to Linux! ;-)
    GTO, Jan 16, 2005
    #5
  6. Facetious, but possibly more helpful than the other responses.

    Brings up a question: using unix dynamic libraries the same problem would
    arise, so how would you recommend working around it?

    "GTO" <> wrote in message
    news:7aiGd.11746$...
    >> Is there a way to work around this that doesn't completely suck?

    >
    > Yes. Switch to Linux! ;-)
    >
    Al A. Palooza, Jan 16, 2005
    #6
  7. Al A. Palooza

    Rolf Magnus Guest

    Al A. Palooza wrote:

    > Facetious, but possibly more helpful than the other responses.


    No. The other responses told you where to ask your question.

    > Brings up a question: using unix dynamic libraries the same problem would
    > arise, so how would you recommend working around it?


    That should be asked in comp.unix.programmer.
    Rolf Magnus, Jan 16, 2005
    #7
  8. God help me, is there a comp.os.pedantic?

    That's four - count 'em, four! - responses, from people who could probably
    offer some valuable advice, but instead just say "take the question
    elsewhere".

    I took the question elsewhere, to three different newsgroups. Not a single
    response there. Guess the only reason people reply is to tell you you're
    off-topic. (Or to make jokes, then tell you responses to the jokes are
    off-topic).

    Usenet is hilarious.

    "Rolf Magnus" <> wrote in message
    news:cscg8l$mpa$01$-online.com...
    > Al A. Palooza wrote:
    >
    >> Facetious, but possibly more helpful than the other responses.

    >
    > No. The other responses told you where to ask your question.
    >
    >> Brings up a question: using unix dynamic libraries the same problem would
    >> arise, so how would you recommend working around it?

    >
    > That should be asked in comp.unix.programmer.
    >
    Al A. Palooza, Jan 16, 2005
    #8
  9. On Sun, 16 Jan 2005 03:10:45 -0500, "Al A. Palooza" <> wrote:

    >That's four - count 'em, four! - responses, from people who could probably
    >offer some valuable advice,


    No. A large number of people on this newsgroup do not program on Microsoft
    Windows, let alone have the VC++ compiler. Even if they did know how to
    program with that operating system, they would not have enough information
    to figure out why the singleton class was crashing. (i.e. they don't know
    which memory manager you were using.)
    Raymond Martineau, Jan 16, 2005
    #9
  10. On Sat, 15 Jan 2005 19:43:50 -0500, Al A. Palooza wrote:

    > Facetious, but possibly more helpful than the other responses.
    >
    > Brings up a question: using unix dynamic libraries the same problem would
    > arise, so how would you recommend working around it?


    Possibly not. As I understand it, under most unices shared objects
    (dynamic libraries) are placed in the loading process's address space,
    rather than having their own address space, which is the source of the
    problem you're having. BICBW.

    F'ups set.

    Owen
    Owen Jacobson, Jan 16, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allan Wong

    DLL Hell in .NET

    Allan Wong, Sep 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,747
    Mark Kamoski
    Sep 25, 2003
  2. BeerBoy

    DLL Hell

    BeerBoy, Feb 23, 2004, in forum: ASP .Net
    Replies:
    8
    Views:
    509
    Kevin Spencer
    Feb 24, 2004
  3. G Dean Blake

    GAC DLL HELL

    G Dean Blake, Feb 8, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    5,105
    Juan T. Llibre
    Feb 11, 2005
  4. Charlie@NISH

    ASP.NET DLL Hell?

    Charlie@NISH, Aug 25, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    4,052
    =?Utf-8?B?TmV2ZXJseW4=?=
    Aug 26, 2005
  5. Gordon Beaton

    JNI help - dll hell!!

    Gordon Beaton, Aug 23, 2004, in forum: Java
    Replies:
    3
    Views:
    1,749
    Chris Uppal
    Aug 24, 2004
Loading...

Share This Page