CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Lindley

Search: Search took 0.09 seconds.

  1. Replies
    5
    Views
    10,304

    Re: Crazy Multiple Definition Problem

    Another option to consider, perhaps more "C++ish", would be a variation on the singleton pattern:

    Some h file


    struct Globals
    {
    static int& getMyIntGlobal()
    {
    static int...
  2. Replies
    5
    Views
    10,304

    Re: Crazy Multiple Definition Problem

    Make sure any declaration of the variable in a header file uses the extern keyword, and that only one source file contains the actual definition.
  3. Replies
    5
    Views
    10,304

    Re: Crazy Multiple Definition Problem

    If the variables aren't even declared anywhere, then any attempts to use them should result in a compile error before you even get to the linker.

    I suspect what you may be facing is a modification...
Results 1 to 3 of 3





Click Here to Expand Forum to Full Width

Featured